linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf record is crashing on system with bpf progs are running
@ 2023-02-23  8:02 RAJESH DASARI
  2023-02-24  3:45 ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: RAJESH DASARI @ 2023-02-23  8:02 UTC (permalink / raw)
  To: linux-perf-users

Hi ,

perf record is crashing on systems with bpf programs are running.

We are running on the 4.18 host kernel and we launch a container ,
inside the container we run perf record command, (bpf program is
running). Perf is built on top of the 5.4.228 kernel.

(gdb) bt
#0  0x000000000055becf in perf_event__synthesize_one_bpf_prog
(opts=0x94def8 <record+280>, event=0xabd910, fd=132, machine=0xaf6208,
process=0x421260 <process_synthesized_event>,
    session=0xaf6090) at util/bpf-event.c:242
#1  perf_event__synthesize_bpf_events (session=session@entry=0xaf6090,
process=process@entry=0x421260 <process_synthesized_event>,
machine=machine@entry=0xaf6208,
    opts=opts@entry=0x94def8 <record+280>) at util/bpf-event.c:333
#2  0x000000000041ff5c in record__synthesize (tail=tail@entry=false,
rec=0x94dde0 <record>) at builtin-record.c:1323
#3  0x0000000000422bc4 in __cmd_record (rec=0x94dde0 <record>,
argv=<optimized out>, argc=<optimized out>) at builtin-record.c:1465
#4  cmd_record (argc=<optimized out>, argv=<optimized out>) at
builtin-record.c:2474
#5  0x0000000000490769 in run_builtin (p=p@entry=0x9574b8
<commands+216>, argc=argc@entry=1, argv=argv@entry=0x7fffffffc120) at
perf.c:312
#6  0x000000000040c05a in handle_internal_command
(argv=0x7fffffffc120, argc=1) at perf.c:364
#7  run_argv (argv=<synthetic pointer>, argcp=<synthetic pointer>) at perf.c:408
#8  main (argc=1, argv=0x7fffffffc120) at perf.c:538

We tried running perf record --no-bpf-event but crash is still seen so
we added the below patch to skip processing bpf events when
no-bpf-event options is provided , but not sure if this is the actual
solution, please provide your inputs.

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 454e275..78e96ad 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1320,11 +1320,12 @@ static int record__synthesize(struct record
*rec, bool tail)
                return err;
        }

-       err = perf_event__synthesize_bpf_events(session,
process_synthesized_event,
-                                               machine, opts);
-       if (err < 0)
-               pr_warning("Couldn't synthesize bpf events.\n");
-
+        if (!opts->no_bpf_event) {
+                err = perf_event__synthesize_bpf_events(session,
process_synthesized_event,
+                                                       machine, opts);
+               if (err < 0)
+                       pr_warning("Couldn't synthesize bpf events.\n");
+        }


Thanks,
Rajesh Dasari.

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

end of thread, other threads:[~2023-03-06 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23  8:02 perf record is crashing on system with bpf progs are running RAJESH DASARI
2023-02-24  3:45 ` Ian Rogers
2023-03-06 15:25   ` RAJESH DASARI
2023-03-06 17:33     ` Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).