public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Eytan Naim <eytanaim@gmail.com>
To: systemtap@sourceware.org
Subject: SystemTap bpf begin probe doesn't work
Date: Sun, 12 Jul 2020 22:37:49 +0300	[thread overview]
Message-ID: <CAADHo-Dyxk82WN_JZsCZZ5vNVEQWPoHb-gqavDS1rH7JsKeowQ@mail.gmail.com> (raw)

Hi,

I'm trying to probe a userspace process with a 'begin' probe that doesn't
seem to do anything

begin.stp:

probe process("a.out").begin {
   printf("%s %d\n", execname(), pid())
}


stp output:

[root@RHEL8 ~]# stap --bpf    -v ~/begin.stp
Pass 1: parsed user script and 56 library scripts using
203356virt/48420res/12256shr/36024data kb, in 100usr/10sys/114real ms.
Pass 2: analyzed script: 2 probes, 3 functions, 0 embeds, 1 global
using 204676virt/50128res/12392shr/37344data kb, in 10usr/10sys/11real
ms.
Pass 3: pass skipped for stapbpf runtime in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_30984.bo" in 0usr/0sys/2real ms.
Pass 5: starting run.

When changing the probe to the main() function it seems to work:

function.stp

probe process("a.out").function("main") {
   printf("%s %d\n", execname(), pid())
}

stap output:

[root@RHEL8 ~]# stap --bpf    -v ~/222.stp
Pass 1: parsed user script and 56 library scripts using
203356virt/48364res/12200shr/36024data kb, in 290usr/50sys/404real ms.
Pass 2: analyzed script: 2 probes, 3 functions, 0 embeds, 1 global
using 204676virt/50996res/13068shr/37344data kb, in 20usr/0sys/25real
ms.
Pass 3: pass skipped for stapbpf runtime in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_31782.bo" in 0usr/0sys/3real ms.
Pass 5: starting run.
a.out 31806
a.out 31821
a.out 31827
a.out 31831

stap version

[root@RHEL8 ~]# stap --version
Systemtap translator/driver (version 4.2/0.178, rpm 4.2-6.el8)
Copyright (C) 2005-2019 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.4-rc6
enabled features: AVAHI BOOST_STRING_REF DYNINST BPF JAVA PYTHON3
LIBRPM LIBSQLITE3 LIBVIRT LIBXML2 NLS NSS READLINE

Needless to say that using the default backend engine works.
Thanks,
Eytan.

                 reply	other threads:[~2020-07-12 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAADHo-Dyxk82WN_JZsCZZ5vNVEQWPoHb-gqavDS1rH7JsKeowQ@mail.gmail.com \
    --to=eytanaim@gmail.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).