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

Introduce helpers to access pt_regs in an arch-independent manner #529

Merged
merged 1 commit into from
May 5, 2016

Conversation

rnav
Copy link
Contributor

@rnav rnav commented May 5, 2016

This addresses some of the review comments on the RFC patch #522 from @goldshtn, @drzaeus77 and @aaronpuchert.

The additional white-space changes in examples/lua/bashreadline.c are for satisfying style-check.

This should help address #225 and #336. Most of the tests/tools now work on powerpc except for those affected by #525.

Convert some of the examples and tools to use the new helpers.

Signed-off-by: Naveen N. Rao <[email protected]>
@drzaeus77
Copy link
Collaborator

Thanks!

@drzaeus77
Copy link
Collaborator

FYI, in the future, it is possible (and preferable) to keep the same PR open for multiple iterations of the review cycle. As long as you keep the same branch open, you can keep pushing changes (force push as well) until the reviewers are happy. Keeping it in one PR preserves the comment chain a little more cleanly :)

@rnav
Copy link
Contributor Author

rnav commented May 5, 2016

Thanks - I had been wondering about that. I thought the previous review comments on the patches will be lost if I do a force-push. Your explanation helps.

@4ast
Copy link
Member

4ast commented May 8, 2016

Seeing errors:
sudo ./funccount.py 'vfs_*'
/virtual/main.c:15:14: warning: implicit declaration of function 'PT_REGS_IP' is invalid in C99 [-Wimplicit-function-declaration]
key.ip = PT_REGS_IP(ctx) & ~3ull;
^
1 warning generated.
LLVM ERROR: Program used external function 'PT_REGS_IP' which could not be resolved!

@rnav
Copy link
Contributor Author

rnav commented May 8, 2016

On 2016/05/07 07:01PM, 4ast wrote:

Seeing errors:
sudo ./funccount.py 'vfs_*'
/virtual/main.c:15:14: warning: implicit declaration of function 'PT_REGS_IP' is invalid in C99 [-Wimplicit-function-declaration]
key.ip = PT_REGS_IP(ctx) & ~3ull;
^
1 warning generated.
LLVM ERROR: Program used external function 'PT_REGS_IP' which could not be resolved!

Weird - I don't see this with my setup on x86/ppc:

/usr/share/bcc/tools/funccount 'vfs_*'

Tracing 47 functions for "vfs_*"... Hit Ctrl-C to end.
^C
ADDR FUNC COUNT
ffffffff812225a0 vfs_fstatat 4
ffffffff81222540 vfs_fstat 5
ffffffff81222440 vfs_getattr_nosec 9
ffffffff81222510 vfs_getattr 9
ffffffff8121bd80 vfs_open 91
ffffffff8121d5c0 vfs_write 97
ffffffff8121d490 vfs_read 264
Detaching...

It looks like clang is not including export/helpers.h for some
reason. If I'm not mistaken, that header should be included
automatically, per commit c597c29.

@4ast
Copy link
Member

4ast commented May 8, 2016

thanks. false alarm. turned out to be typical double libbcc.so problem.
I did 'rm CMakeCache.txt' which suppose to clear cache only, but it lost the settings of -DCMAKE_INSTALL_PREFIX=/usr and defaulted to /usr/local instead.

sandip4n added a commit to sandip4n/bcc that referenced this pull request Oct 18, 2017
This fixes the definition of PT_REGS_SP() for powerpc. There
is no member called 'sp' in 'pt_regs' for powerpc. According
to ELF ABI v2, GPR1 should be used as the stack pointer.

Fixes: iovisor#529
Signed-off-by: Sandipan Das <[email protected]>
sandip4n added a commit to sandip4n/bcc that referenced this pull request Oct 18, 2017
This fixes the definition of PT_REGS_SP() for powerpc to refer
to GPR1.

Fixes: iovisor#529
Signed-off-by: Sandipan Das <[email protected]>
sandip4n added a commit to sandip4n/bcc that referenced this pull request Oct 18, 2017
This fixes the definition of PT_REGS_SP() for powerpc to refer
to GPR1.

Fixes: iovisor#529
       4afa96a ("cc: introduce helpers to access pt_regs in an arch-independent manner")
Signed-off-by: Sandipan Das <[email protected]>
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
This fixes the definition of PT_REGS_SP() for powerpc to refer
to GPR1.

Fixes: iovisor#529
       4afa96a ("cc: introduce helpers to access pt_regs in an arch-independent manner")
Signed-off-by: Sandipan Das <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants