all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths
@ 2022-08-05 15:49 Olivier Dion via Guix-patches via
  2022-08-06 13:37 ` Mathieu Othacehe
  2022-08-31 21:05 ` bug#57008: " Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Olivier Dion via Guix-patches via @ 2022-08-05 15:49 UTC (permalink / raw)
  To: 57008; +Cc: Olivier Dion, othacehe

* gnu/packages/instrumentation.scm (perf-tools): Add patch phase.
[phases]: Add patch-paths.
---
 gnu/packages/instrumentation.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/instrumentation.scm b/gnu/packages/instrumentation.scm
index f52cf11505..95724f976b 100644
--- a/gnu/packages/instrumentation.scm
+++ b/gnu/packages/instrumentation.scm
@@ -308,7 +308,15 @@ (define-public perf-tools
                (base32 "1ab735idi0h62yvhzd7822jj3555vygixv4xjrfrdvi8d2hhz6qn"))))
     (build-system copy-build-system)
     (arguments
-     `(#:install-plan
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-paths
+           (lambda _
+             (substitute* '("execsnoop" "killsnoop" "kernel/funcslower")
+               (("/usr/bin/gawk") (which "awk")))
+             (substitute* '"execsnoop"
+               (("/usr/bin/getconf") (which "getconf"))))))
+       #:install-plan
        ',(append
           (map (cut list <> "bin/")
                '("disk/bitesize"
-- 
2.37.1





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

* [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths
  2022-08-05 15:49 [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths Olivier Dion via Guix-patches via
@ 2022-08-06 13:37 ` Mathieu Othacehe
  2022-08-06 14:45   ` Olivier Dion via Guix-patches via
  2022-08-31 21:05 ` bug#57008: " Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Mathieu Othacehe @ 2022-08-06 13:37 UTC (permalink / raw)
  To: Olivier Dion; +Cc: bug#57008


Hello Olivier,

> * gnu/packages/instrumentation.scm (perf-tools): Add patch phase.
> [phases]: Add patch-paths.

Somehow I still have the same error. Here a complete report:

--8<---------------cut here---------------start------------->8---
mathieu@meije ~/guix [env]$ sudo bash -x execsnoop
+ tracing=/sys/kernel/debug/tracing
+ flock=/var/tmp/.ftrace-lock
+ wroteflock=0
+ opt_duration=0
+ duration=
+ opt_name=0
+ name=
+ opt_time=0
+ opt_reexec=0
+ opt_argc=0
+ argc=8
+ max_argc=16
+ ftext=
+ trap : INT QUIT TERM PIPE HUP
+ getopts a:d:hrt opt
+ shift 0
+ ((  0  ))
+ ((  0  ))
+ ((  opt_pid && opt_name  ))
+ ((  opt_pid  ))
+ ((  opt_name  ))
+ ((  opt_file  ))
+ ((  opt_argc && argc > max_argc  ))
+ ((  opt_duration  ))
+ echo 'Tracing exec()s. Ctrl-C to end.'
Tracing exec()s. Ctrl-C to end.
+ ((  opt_duration  ))
+ [[ -x /gnu/store/55q02v1a3qz8n7rlhy3jva9qjkfwj8y0-gawk-5.1.0/bin/awk ]]
+ awk=gawk
+ cd /sys/kernel/debug/tracing
+ [[ -e /var/tmp/.ftrace-lock ]]
+ echo 25361
+ wroteflock=1
+ [[ -x /gnu/store/bxh206gz379wkn8cvb2ghlkvpqgwfd2v-gcc-toolchain-10.3.0/bin/getconf ]]
++ getconf LONG_BIT
+ bits=64
+ ((  offset = bits / 8  ))
+ makeprobe sys_execve
+ func=sys_execve
+ kname=execsnoop_sys_execve
+ kprobe='p:execsnoop_sys_execve sys_execve'
+ i=0
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_sys_execve sys_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string +0(+64(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ echo nop
+ echo p:execsnoop_sys_execve sys_execve '+0(+0(%si)):string' '+0(+8(%si)):string' '+0(+16(%si)):string' '+0(+24(%si)):string' '+0(+32(%si)):string' '+0(+40(%si)):string' '+0(+48(%si)):string' '+0(+56(%si)):string' '+0(+64(%si)):string'
+ makeprobe stub_execve
+ func=stub_execve
+ kname=execsnoop_stub_execve
+ kprobe='p:execsnoop_stub_execve stub_execve'
+ i=0
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_stub_execve stub_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string +0(+64(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ echo p:execsnoop_stub_execve stub_execve '+0(+0(%si)):string' '+0(+8(%si)):string' '+0(+16(%si)):string' '+0(+24(%si)):string' '+0(+32(%si)):string' '+0(+40(%si)):string' '+0(+48(%si)):string' '+0(+56(%si)):string' '+0(+64(%si)):string'
+ makeprobe do_execve
+ func=do_execve
+ kname=execsnoop_do_execve
+ kprobe='p:execsnoop_do_execve do_execve'
+ i=0
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ kprobe='p:execsnoop_do_execve do_execve +0(+0(%si)):string +0(+8(%si)):string +0(+16(%si)):string +0(+24(%si)):string +0(+32(%si)):string +0(+40(%si)):string +0(+48(%si)):string +0(+56(%si)):string +0(+64(%si)):string'
+ ((  i++  ))
+ ((  i < argc + 1  ))
+ echo p:execsnoop_do_execve do_execve '+0(+0(%si)):string' '+0(+8(%si)):string' '+0(+16(%si)):string' '+0(+24(%si)):string' '+0(+32(%si)):string' '+0(+40(%si)):string' '+0(+48(%si)):string' '+0(+56(%si)):string' '+0(+64(%si)):string'
+ edie 'ERROR: adding a kprobe for execve. Exiting.'
+ echo 'ERROR: adding a kprobe for execve. Exiting.'
ERROR: adding a kprobe for execve. Exiting.
+ exec
--8<---------------cut here---------------end--------------->8---

Any idea why?

Thanks,

Mathieu




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

* [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths
  2022-08-06 13:37 ` Mathieu Othacehe
@ 2022-08-06 14:45   ` Olivier Dion via Guix-patches via
  0 siblings, 0 replies; 6+ messages in thread
From: Olivier Dion via Guix-patches via @ 2022-08-06 14:45 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: bug#57008

On Sat, 06 Aug 2022, Mathieu Othacehe <othacehe@gnu.org> wrote:
> Hello Olivier,
>
>> * gnu/packages/instrumentation.scm (perf-tools): Add patch phase.
>> [phases]: Add patch-paths.
>
> Somehow I still have the same error. Here a complete report:

Right.  There's still a problem with kprobe and execsnoop.  However,
this patch does fix some other scripts that are using awk and getconf.

> Any idea why?

The only thing I can think of is that the symbol used by execsnoop for
instrumenting the kernel was changed and is not in /proc/kallsyms.  I'll
try to dig that later this week.

-- 
Olivier Dion
oldiob.dev




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

* bug#57008: [PATCH] gnu: perf-tools: Patch executable paths
  2022-08-05 15:49 [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths Olivier Dion via Guix-patches via
  2022-08-06 13:37 ` Mathieu Othacehe
@ 2022-08-31 21:05 ` Ludovic Courtès
  2022-09-01 15:38   ` [bug#57008] " Mathieu Othacehe
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2022-08-31 21:05 UTC (permalink / raw)
  To: Olivier Dion; +Cc: 57008-done, othacehe

Hi Olivier & Mathieu,

Olivier Dion <olivier.dion@polymtl.ca> skribis:

> * gnu/packages/instrumentation.scm (perf-tools): Add patch phase.
> [phases]: Add patch-paths.

[...]

> +             (substitute* '("execsnoop" "killsnoop" "kernel/funcslower")
> +               (("/usr/bin/gawk") (which "awk")))
> +             (substitute* '"execsnoop"
> +               (("/usr/bin/getconf") (which "getconf"))))))

I went ahead and applied a modified version of this patch that uses
‘search-input-file’ instead of ‘which’.

Thanks,
Ludo’.




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

* [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths
  2022-08-31 21:05 ` bug#57008: " Ludovic Courtès
@ 2022-09-01 15:38   ` Mathieu Othacehe
  2022-09-01 15:56     ` Olivier Dion via Guix-patches via
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Othacehe @ 2022-09-01 15:38 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Olivier Dion, 57008-done


Hey,

> I went ahead and applied a modified version of this patch that uses
> ‘search-input-file’ instead of ‘which’.

Thanks Ludo! Olivier, any progress on the execsnoop issue :) ?

Mathieu




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

* [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths
  2022-09-01 15:38   ` [bug#57008] " Mathieu Othacehe
@ 2022-09-01 15:56     ` Olivier Dion via Guix-patches via
  0 siblings, 0 replies; 6+ messages in thread
From: Olivier Dion via Guix-patches via @ 2022-09-01 15:56 UTC (permalink / raw)
  To: Mathieu Othacehe, Ludovic Courtès; +Cc: 57008-done

On Thu, 01 Sep 2022, Mathieu Othacehe <othacehe@gnu.org> wrote:
> Hey,
>
>> I went ahead and applied a modified version of this patch that uses
>> ‘search-input-file’ instead of ‘which’.
>
> Thanks Ludo! Olivier, any progress on the execsnoop issue :) ?

Nope.  I did not had time to check it again sorry :-/

Maybe there's somehing missing on the kernel side.  I will would check
that /sys/kernel/debug/tracing/events has the tracepoints used by
execsnoop and that the tracers ftrace and kprobe are correctly
configured.

-- 
Olivier Dion
oldiob.dev




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

end of thread, other threads:[~2022-09-01 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-05 15:49 [bug#57008] [PATCH] gnu: perf-tools: Patch executable paths Olivier Dion via Guix-patches via
2022-08-06 13:37 ` Mathieu Othacehe
2022-08-06 14:45   ` Olivier Dion via Guix-patches via
2022-08-31 21:05 ` bug#57008: " Ludovic Courtès
2022-09-01 15:38   ` [bug#57008] " Mathieu Othacehe
2022-09-01 15:56     ` Olivier Dion via Guix-patches via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.