Bug 519314 - "type definition 'task_struct' not found" in task_pid() function
Summary: "type definition 'task_struct' not found" in task_pid() function
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: systemtap
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Frank Ch. Eigler
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On: 515829
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-26 03:15 UTC by dongjibing
Modified: 2010-03-30 09:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 09:06:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0308 0 normal SHIPPED_LIVE systemtap bug fix and enhancement update 2010-03-29 14:36:19 UTC

Description dongjibing 2009-08-26 03:15:18 UTC
Description of problem:
when call task_pid() function in systemtap script,an semantic error happen:

semantic error: type definition 'task_struct' not found: identifier '@cast' at /usr/share/systemtap/tapset/task.stp:62:12
        source:     return @cast(task, "task_struct", "kernel")->tgid
                           ^
Pass 2: analysis failed.  Try again with another '--vp 01' option.

Version-Release number of selected component (if applicable):

SystemTap translator/driver (version 0.9.7/0.141 non-git sources)

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 dongjibing 2009-08-26 03:28:33 UTC
require to have the kernel debuginfo package installed

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Mark Wielaard 2009-08-26 08:16:40 UTC
Could you give a full example?

With the following version:

$ stap -V SystemTap translator/driver (version 0.9.7/0.141 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
$ rpm -q systemtap kernel kernel-debuginfo
systemtap-0.9.7-5.el5
kernel-2.6.18-155.el5
kernel-debuginfo-2.6.18-155.el5

The following works fine for me:

$ stap -e 'probe begin { printf("pid: %d\n", task_pid(task_current())); exit(); }'
pid: 3190

Comment 3 Frank Ch. Eigler 2009-08-26 11:24:08 UTC
Without kernel-debuginfo, @cast() can do the job, but only if one
identifies the header file that declares the type. 

 @cast(ptr,"task_struct","kernel<linux/sched.h>"

Perhaps this change belongs to the tapset.

Comment 5 Frank Ch. Eigler 2009-10-20 17:21:38 UTC
systemtap upstream commit 8aa140d includes the fix from comment #3.

Comment 10 errata-xmlrpc 2010-03-30 09:06:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0308.html


Note You need to log in before you can comment on or make changes to this bug.