This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
can't print a target pointer string field
- From: Jeff Haran <Jeff dot Haran at citrix dot com>
- To: "'systemtap at sourceware dot org'" <systemtap at sourceware dot org>
- Date: Fri, 7 Sep 2012 17:26:41 -0700
- Subject: can't print a target pointer string field
Hi,
First off, if this is the wrong place to be posting dumb newbie user questions like this, please let me know if there is a more appropriate venue.
I am trying to displayt the name of the device associated with a struct sk_buff, but am getting an error when stap parses my script:
[root@s01b06 jharan]# cat neigh_event_send.stp
global hit
probe kernel.statement("*@net/core/neighbour.c:934")
{
printf("__neigh_event_send() hit %d, skb %x, dev %x, name %s\n", hit++, $skb, $skb->dev, $skb->dev->name)
}
[root@s01b06 jharan]# stap -v -r 2.6.32-220.el6.x86_64 neigh_event_send.stp -m neigh_event_send -p 4
Pass 1: parsed user script and 77 library script(s) using 97288virt/22844res/2920shr kb, in 130usr/10sys/143real ms.
semantic error: type mismatch ( long vs. string ): identifier '$skb' at neigh_event_send.stp:4:98
source: printf("__neigh_event_send() hit %d, skb %x, dev %x, name %s\n", hit++, $skb, $skb->dev, $skb->dev->name)
^
Pass 2: analyzed script: 1 probe(s), 3 function(s), 0 embed(s), 1 global(s) using 271644virt/81032res/19500shr kb, in 190usr/80sys/267real ms.
Pass 2: analysis failed. Try again with another '--vp 01' option.
[root@s01b06 jharan]#
On a fixed font, the '^' pointing out the error shows up under the last parameter to printf (the '$' at the beginning of $skb->dev->name).
skb is a pointer to one of these (omitting most fields for brevity):
struct sk_buff {
...
struct net_device *dev;
...
};
struct net_device looks like:
struct net_device
{
...
char name[IFNAMSIZ];
...
};
So skb->dev->name looks like a string to me.
Why the reported type mismatch? And how can I display the name field, if that's possible?
Thanks,
Jeff Haran