public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* Question: CO-RE-enabled PT_REGS macros give strange results
@ 2023-07-24 10:32 Timofei Pushkin
  2023-07-24 12:36 ` Alan Maguire
  0 siblings, 1 reply; 11+ messages in thread
From: Timofei Pushkin @ 2023-07-24 10:32 UTC (permalink / raw)
  To: bpf

Dear BPF community,

I'm developing a perf_event BPF program which reads some register
values (frame and instruction pointers in particular) from the context
provided to it. I found that CO-RE-enabled PT_REGS macros give results
different from the results of the usual PT_REGS  macros. I run the
program on the same system I compiled it on, and so I cannot
understand why the results differ and which ones should I use?

From my tests, the results of the usual macros are the correct ones
(e.g. I can symbolize the instruction pointers I get this way), but
since I try to follow the CO-RE principle, it seems like I should be
using the CO-RE-enabled variants instead.

I did some experiments and found out that it is the
bpf_probe_read_kernel part of the CO-RE-enabled PT_REGS macros that
change the results and not __builtin_preserve_access_index. But I
still don't get why exactly it changes the results.

Thank you in advance,
Timofei

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-28 12:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 10:32 Question: CO-RE-enabled PT_REGS macros give strange results Timofei Pushkin
2023-07-24 12:36 ` Alan Maguire
2023-07-24 15:04   ` Timofei Pushkin
2023-07-24 23:00     ` Alan Maguire
2023-07-25 14:04       ` Alan Maguire
2023-07-26  0:03         ` Eduard Zingerman
2023-07-26 13:46           ` Alan Maguire
2023-07-26 20:03             ` Eduard Zingerman
2023-07-26 23:39               ` Eduard Zingerman
2023-07-28  3:03                 ` Yonghong Song
2023-07-28 12:30                   ` Eduard Zingerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox