Bug 4254 - testsuite/buildok/twenty.stp needs change for 2.6.21-rc1 and above kernel.
Summary: testsuite/buildok/twenty.stp needs change for 2.6.21-rc1 and above kernel.
Status: VERIFIED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: testsuite (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-22 12:12 UTC by Srinivasa DS
Modified: 2007-03-22 13:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srinivasa DS 2007-03-22 12:12:04 UTC
Since there has been change in the kernel, testsuite/buildok/twent.stp doesn't
work and hence fails.
We need to change this testcase to make it work.

Earlier testcase looks like this.
===================================================
#! stap -gp4

# Test for writing to target variables, PR 1131

probe kernel.function("vfs_readdir")
{
        $file->f_dentry->d_name->len = 1
}
=============================================
Which has to be changed to this 
========================================
#! stap -gp4

# Test for writing to target variables, PR 1131

probe kernel.function("vfs_readdir")
{
        $file->f_path->dentry->d_name->len = 1;
}
=================================================

Due to this change in include/linux/file.h
===================================
struct file {
        /*
         * fu_list becomes invalid after file_free is called and queued via
         * fu_rcuhead for RCU freeing
         */
        union {
                struct list_head        fu_list;
                struct rcu_head         fu_rcuhead;
        } f_u;
        struct path             f_path; ====> change
#define f_dentry        f_path.dentry
#define f_vfsmnt        f_path.mnt
        const struct file_operations    *f_op;
        atomic_t                f_count;
        unsigned int            f_flags;
        mode_t                  f_mode;
        loff_t                  f_pos;
=============================================

Please let me know your comments on this.
Comment 1 pierre.peiffer@bull.net 2007-03-22 12:34:37 UTC
Subject: Re:  New: testsuite/buildok/twenty.stp needs
 change for 2.6.21-rc1 and above  kernel.

I've sent a correction for that few weeks ago and Frank Ch. Eigler has 
integrated it few days ago.
=> now available in CVS

P.

srinivasa at in dot ibm dot com a écrit :
> Since there has been change in the kernel, testsuite/buildok/twent.stp doesn't
> work and hence fails.
> We need to change this testcase to make it work.
> 
> Earlier testcase looks like this.
> ===================================================
> #! stap -gp4
> 
> # Test for writing to target variables, PR 1131
> 
> probe kernel.function("vfs_readdir")
> {
>         $file->f_dentry->d_name->len = 1
> }
> =============================================
> Which has to be changed to this 
> ========================================
> #! stap -gp4
> 
> # Test for writing to target variables, PR 1131
> 
> probe kernel.function("vfs_readdir")
> {
>         $file->f_path->dentry->d_name->len = 1;
> }
> =================================================
> 
> Due to this change in include/linux/file.h
> ===================================
> struct file {
>         /*
>          * fu_list becomes invalid after file_free is called and queued via
>          * fu_rcuhead for RCU freeing
>          */
>         union {
>                 struct list_head        fu_list;
>                 struct rcu_head         fu_rcuhead;
>         } f_u;
>         struct path             f_path; ====> change
> #define f_dentry        f_path.dentry
> #define f_vfsmnt        f_path.mnt
>         const struct file_operations    *f_op;
>         atomic_t                f_count;
>         unsigned int            f_flags;
>         mode_t                  f_mode;
>         loff_t                  f_pos;
> =============================================
> 
> Please let me know your comments on this.
> 

Comment 2 Srinivasa DS 2007-03-22 13:29:27 UTC
I saw the latest snapshot released on saturday, in which testcase was not
modified and hence I changed it.
I should have gone through CVS before, Iam sorry.

Thanks
 Srinivasa DS
Comment 3 Srinivasa DS 2007-03-22 13:33:03 UTC
I have verified the test, Its working fine.

Thanks
 Srinivasa DS