-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
funccount: filter bcc function count #645
Conversation
ok to test |
style issues (these tools are included in other environments that will run pep8):
Also, when using "-p PID", the logic has redundancies; eg, from the compiled BPF script:
I passed it "-p 11". |
I fix the style issues and logical error, generate commit.
Run command It filter the current bcc process 10075 or pid not equals 2716. |
I'd fix this further: these are early examples, and people are likely to copy-n-paste what we create to make other tools, so it's worth getting as nice as possible to start with. That filter should be: if (pid != 2716) { return 0; } If you've specified -p, I don't see a reason to also check that it's not its own PID. ie, the code could be: if args.pid:
filter_text += "if (pid != %s) { return 0; }" % args.pid
else:
filter_text += "if (pid == %s) { return 0; }" % os.getpid() unless I've missed something? Thanks. |
Yes, you are right. when pid special, no reason to check it own PID again, fix it:
run
run Thanks. |
ok to test |
ok, LGTM. |
No description provided.