This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: too many transport failure


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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]