GNU bug report logs - #57008
[PATCH] gnu: perf-tools: Patch executable paths

Previous Next

Package: guix-patches;

Reported by: Olivier Dion <olivier.dion <at> polymtl.ca>

Date: Fri, 5 Aug 2022 15:50:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57008 in the body.
You can then email your comments to 57008 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57008; Package guix-patches. (Fri, 05 Aug 2022 15:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Olivier Dion <olivier.dion <at> polymtl.ca>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 05 Aug 2022 15:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Olivier Dion <olivier.dion <at> polymtl.ca>
To: guix-patches <at> gnu.org
Cc: Olivier Dion <olivier.dion <at> polymtl.ca>, othacehe <at> gnu.org
Subject: [PATCH] gnu: perf-tools: Patch executable paths
Date: Fri,  5 Aug 2022 11:49:26 -0400
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#57008; Package guix-patches. (Sat, 06 Aug 2022 13:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 57008 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Olivier Dion <olivier.dion <at> polymtl.ca>
Cc: bug#57008 <57008 <at> debbugs.gnu.org>
Subject: Re: [PATCH] gnu: perf-tools: Patch executable paths
Date: Sat, 06 Aug 2022 15:37:31 +0200
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 <at> 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




Information forwarded to guix-patches <at> gnu.org:
bug#57008; Package guix-patches. (Sat, 06 Aug 2022 14:46:02 GMT) Full text and rfc822 format available.

Message #11 received at 57008 <at> debbugs.gnu.org (full text, mbox):

From: Olivier Dion <olivier.dion <at> polymtl.ca>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: bug#57008 <57008 <at> debbugs.gnu.org>
Subject: Re: [PATCH] gnu: perf-tools: Patch executable paths
Date: Sat, 06 Aug 2022 10:45:07 -0400
On Sat, 06 Aug 2022, Mathieu Othacehe <othacehe <at> 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




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 31 Aug 2022 21:06:02 GMT) Full text and rfc822 format available.

Notification sent to Olivier Dion <olivier.dion <at> polymtl.ca>:
bug acknowledged by developer. (Wed, 31 Aug 2022 21:06:02 GMT) Full text and rfc822 format available.

Message #16 received at 57008-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Olivier Dion <olivier.dion <at> polymtl.ca>
Cc: 57008-done <at> debbugs.gnu.org, othacehe <at> gnu.org
Subject: Re: bug#57008: [PATCH] gnu: perf-tools: Patch executable paths
Date: Wed, 31 Aug 2022 23:05:36 +0200
Hi Olivier & Mathieu,

Olivier Dion <olivier.dion <at> 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’.




Information forwarded to guix-patches <at> gnu.org:
bug#57008; Package guix-patches. (Thu, 01 Sep 2022 15:39:01 GMT) Full text and rfc822 format available.

Message #19 received at 57008-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Olivier Dion <olivier.dion <at> polymtl.ca>, 57008-done <at> debbugs.gnu.org
Subject: Re: bug#57008: [PATCH] gnu: perf-tools: Patch executable paths
Date: Thu, 01 Sep 2022 17:38:31 +0200
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




Information forwarded to guix-patches <at> gnu.org:
bug#57008; Package guix-patches. (Thu, 01 Sep 2022 15:58:01 GMT) Full text and rfc822 format available.

Message #22 received at 57008-done <at> debbugs.gnu.org (full text, mbox):

From: Olivier Dion <olivier.dion <at> polymtl.ca>
To: Mathieu Othacehe <othacehe <at> gnu.org>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 57008-done <at> debbugs.gnu.org
Subject: Re: bug#57008: [PATCH] gnu: perf-tools: Patch executable paths
Date: Thu, 01 Sep 2022 11:56:57 -0400
On Thu, 01 Sep 2022, Mathieu Othacehe <othacehe <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Sep 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.