public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Josh Stone <jistone@redhat.com>
To: Zhiwei Ying <zhiwei.ying@gmail.com>
Cc: systemtap@sourceware.org
Subject: Re: too many transport failure
Date: Fri, 01 Apr 2011 18:18:00 -0000	[thread overview]
Message-ID: <4D9616F0.6020807@redhat.com> (raw)
In-Reply-To: <AANLkTinWkY_3QL4CEkXcLO-BMvwSrb3PNpNweFbGXdfi@mail.gmail.com>

On 04/01/2011 02:10 AM, Zhiwei Ying wrote:
> Thanks for the help.
> 
> If I store the pp and address in the global array, will that cause a
> lot of runtime overhead? Do I need to check whether the pp is saved in
> the global array or not in every function tracing?

You could store it as an associative array, so overwriting is no issue:

  global pps
  ...
  probe ... {
    ip = REG_IP()
    pps[ip] = pp()
  }

The overhead is not too big, just a hash table lookup and a string copy.
 You could add "if (!(ip in pps))" to avoid the string copy, but then
you're doing the hash table twice.  It's probably not a big deal for
performance either way, but the more troubling part is that you'd be
storing all the visited pp() strings again in kernel memory, which you
said is limited.

> Do we have solutions like "stap -l", which prints out function name
> and source code information, if it comes with function address, then
> it looks perfect.

If you examine pass-2 (option -p2), you'll see the probe addresses.  But
since you're dealing with relocatable modules, it will give an address
relative to wherever the .text section of the module is loaded at
runtime.  For example:

> $ stap -e 'probe module("video").function("*").call {}' -p2 -w
> # probes
> module("video").function("input_report_key@include/linux/input.h:1374").call /* pc=.text+0x518 */ /* <- module("video").function("*").call */
> module("video").function("acpi_video_bus_DOS@drivers/acpi/video.c:763").call /* pc=.text+0x135 */ /* <- module("video").function("*").call */
> module("video").function("acpi_video_device_state_seq_show@drivers/acpi/video.c:1201").call /* pc=.text+0xf26 */ /* <- module("video").function("*").call */

  parent reply	other threads:[~2011-04-01 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01  0:40 Zhiwei Ying
2011-04-01  1:35 ` Josh Stone
2011-04-01  9:10   ` Zhiwei Ying
2011-04-01 10:45     ` Adrien Kunysz
2011-04-01 18:18     ` Josh Stone [this message]
2011-04-01 19:48   ` Frank Ch. Eigler
2011-04-01 20:07     ` Josh Stone
2011-04-06  1:33       ` Zhiwei Ying

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=4D9616F0.6020807@redhat.com \
    --to=jistone@redhat.com \
    --cc=systemtap@sourceware.org \
    --cc=zhiwei.ying@gmail.com \
    /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).