Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when trying to use "strcmp" and "execname" on ubuntu 17.04 #26

Closed
prakashsurya opened this issue Aug 22, 2017 · 1 comment
Closed

Comments

@prakashsurya
Copy link

prakashsurya commented Aug 22, 2017

This is my first time trying to use ply, so I apologize if this is a self induced issue, but I'm trying to execute the following command (example taken from the man page):

$ sudo ply -c 'kprobe:SyS_* / !strcmp(execname, "dd") / { @[func()].count() }'
ERR static_post         : node:<auto>.strcmp (type:call/none size:0x0 loc:nowhere) : Invalid argument
ERR annotate_script     : static type inference failed

Any clues as to what might be causing the error? and/or maybe point me to some docs/source code so I can try to read up on how this is supposed to work?

I built ply from source, and am using an Ubuntu 17.04 system:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty

$ uname -a
Linux ubuntu 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ ply -v
ply-v1-beta1(9e810b1) (linux-version:264712~4.10.8)

I had to download Ubuntu's kernel sources, and use the --with-kerneldir option to workaround #7

@prakashsurya
Copy link
Author

sorry for the noise. reading the manual some more, I see that execname should actually be execname(); the parenthesis were left out in the example I was copying, and resulted in that error message.

it's working now:

$ sudo ply -t 10 -c 'kprobe:SyS_* / !strcmp(execname(), "dd") / { @[func()].count() }'
341 probes active
de-activating probes

@:
sys_rt_sigaction               3
sys_mmap                       7
sys_write                 486862
sys_read                  487095

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant