public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug bpf/27032] New: bpf: -c CMD option does not work
@ 2020-12-07 20:47 agentzh at gmail dot com
  2021-02-04 16:31 ` [Bug bpf/27032] " wcohen at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: agentzh at gmail dot com @ 2020-12-07 20:47 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27032

            Bug ID: 27032
           Summary: bpf: -c CMD option does not work
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bpf
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

I've noticed that stap's `-c CMD` option does not work as expected in the bpf
backend. Tested the latest master branch on Fedora 32 x86_64:

```
[agentzh@fed32-min ~/git/systemtap 0 (master)]$ cat a.c
long a = 0xdeadbeef;

int main (void) {
    return 0;
}

[agentzh@fed32-min ~/git/systemtap 0 (master)]$ gcc -g a.c -o /tmp/a.out

[agentzh@fed32-min ~/git/systemtap 0 (master)]$ /opt/stap/bin/stap --bpf -c
/tmp/a.out -e 'probe process("/tmp/a.out").function("main") { warn("Hit")
exit() }'
```

The last command hangs forever which means that the `/tmp/a.out` command
specified in the `-c` option never gets traced. If I run that command in
another terminal of the same machine, then that `stap` command prints and quits
immediately:

```
[agentzh@fed32-min ~/git/systemtap 0 (master)]$ /opt/stap/bin/stap --bpf -c
/tmp/a.out -e 'probe process("/tmp/a.out").function("main") { warn("Hit")
exit() }'
WARNING: Hit
```

More info about my stap and kernel:

```
[agentzh@fed32-min ~/git/systemtap 130 (master)]$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 4.5/0.182, commit
release-4.4-24-g3e0d449fe427 + changes)
Copyright (C) 2005-2020 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.10.0-rc
enabled features: BPF NLS

[agentzh@fed32-min ~/git/systemtap 0 (master)]$ cat /proc/version
Linux version 5.9.11-100.fc32.x86_64
(mockbuild@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 10.2.1 20201016 (Red
Hat 10.2.1-6), GNU ld version 2.34-6.fc32) #1 SMP Tue Nov 24 19:16:53 UTC 2020
```

Tested the same example on Fedora 28 with an older kernel. Same thing:

```
[agentzh@glass ~/git/systemtap.new 0 (master)]$ /opt/stap/bin/stap --bpf -c
/tmp/a.out -e 'probe process("/tmp/a.out").function("main") { warn("Hit")
exit() }'

[agentzh@glass ~/git/systemtap.new 134 (master)]$ cat /proc/version
Linux version 5.0.16-100.fc28.x86_64
(mockbuild@bkernel04.phx2.fedoraproject.org) (gcc version 8.3.1 20190223 (Red
Hat 8.3.1-2) (GCC)) #1 SMP Tue May 14 18:22:28 UTC 2019
```

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug bpf/27032] bpf: -c CMD option does not work
  2020-12-07 20:47 [Bug bpf/27032] New: bpf: -c CMD option does not work agentzh at gmail dot com
@ 2021-02-04 16:31 ` wcohen at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: wcohen at redhat dot com @ 2021-02-04 16:31 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=27032

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |wcohen at redhat dot com

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
This looks to be the same as PR25177.

*** This bug has been marked as a duplicate of bug 25177 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2021-02-04 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 20:47 [Bug bpf/27032] New: bpf: -c CMD option does not work agentzh at gmail dot com
2021-02-04 16:31 ` [Bug bpf/27032] " wcohen at redhat dot com

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 read-only IMAP folder(s) and NNTP newsgroup(s).