This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: How to access g_probe_timing
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Arkady <larytet at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Wed, 25 Jan 2017 06:06:05 -0500
- Subject: Re: How to access g_probe_timing
- Authentication-results: sourceware.org; auth=none
- References: <CANA-60p+7jCJctd3AZRZMv9B5UWOkRws33VTS4gFBbQVb=V_Ug@mail.gmail.com>
larytet wrote:
> [...]
> I would like to expose the collected [probe run-time] statistics via sysfs or proc.
> I have added a C function to my script which looks like this
> [...]
> {
> Stat *stat = &g_probe_timing[i];
> [...]
> The build fails with "error: 'g_probe_timing' undeclared"
>
> Is there an example of how I can access the collected performance data?
We haven't given this aspect much thought before. Undocumented
variables that are internal to the stap runtime, or especially to
generated code, by nature do not have portable examples. For example,
current git-HEAD versions use a probe_timing() macro. You'd need to
inspect the output of "stap -p3 -t -e 'probe begin {}'" and match that
somehow.
You might also check out "stap --monitor" mode in version 3.0 or
git-HEAD. Under the covers, it includes exporting of some probe stats
to userspace.
- FChE