This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: access pointer and global variables


Stone, Joshua I wrote:
    probe kernel.function("schedule") {
        cache[...] = $prev
    }
    probe kernel.function("schedule").return {
        printf("pid is %d\n", cache[...]->pid)
        // The dereference happens using the same loc2c
        // generated function that the entry would have used.
    }

I just realized that this still looks a lot like what you were grumbling about. The difference I was try to make is that I don't expect that we should ever support users writing this kind of code directly. Trying to track the "original" type of arbitrary longs passed around is extremely hairy. But in a controlled environment, where this is happening behind the scenes in the translator, I think it's more manageable.


OR

    probe kernel.function("schedule") {
        cache[...] = $prev->pid
    }
    probe kernel.function("schedule").return {
        printf("pid is %d\n", cache[...])
    }

But I would still be happy with this, which I don't think would require too much change.


Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]