Skip to contentSkip to conversation

ftrace: change the export format of trace_kfree_skb()

PATCH Superseded Xiao Guangrong 2 participants 3 messages Jun 8, 2009 – Jun 9, 2009

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: change the export format of trace_kfree_skb()

Use %pf instead of %p to output the function's address, use 0x%04X instead of %u to output the skb's protocol

Before patch:

          <idle>-0     [000] 60144.542521: kfree_skb: skbaddr=de7b8240 protocol=2048 location=c1365429
          <idle>-0     [000] 60164.488153: kfree_skb: skbaddr=da66f900 protocol=2048 location=c1365429
          <idle>-0     [000] 60193.493933: kfree_skb: skbaddr=deaeb480 protocol=4 location=c134ec25
          <idle>-0     [000] 60253.118421: kfree_skb: skbaddr=de7c4900 protocol=4 location=c134ec25

After patch:

            bash-2587  [001] 97685.781173: kfree_skb: skbaddr=deb9cc00 protocol=0x0000 location=netlink_unicast
            bash-2587  [000] 97686.501121: kfree_skb: skbaddr=df9bb840 protocol=0x0000 location=netlink_unicast
          <idle>-0     [000] 97696.200184: kfree_skb: skbaddr=df741240 protocol=0x0800 location=ip_rcv
          <idle>-0     [000] 97696.200198: kfree_skb: skbaddr=dfb3de40 protocol=0x0800 location=ip_rcv
---
 include/trace/events/skb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 include/trace/events/skb.h
include/trace/events/skb.h +1 -1
old mode 100644
new mode 100755
index 1e8fabb..a58bef8
@@ -30,7 +30,7 @@ TRACE_EVENT(kfree_skb,
 		__entry->location = location;
 	),
 
-	TP_printk("skbaddr=%p protocol=%u location=%p",
+	TP_printk("skbaddr=%p protocol=0x%04X location=%pf",
 		__entry->skbaddr, __entry->protocol, __entry->location)
 );
 
Signature · 1 line
1.6.1.2
#1 lore raw
Quoted 30 lines · Xiao Guangrong

Use %pf instead of %p to output the function's address, use 0x%04X instead of %u to output the skb's protocol

Before patch:

          <idle>-0     [000] 60144.542521: kfree_skb: skbaddr=de7b8240 protocol=2048 location=c1365429
          <idle>-0     [000] 60164.488153: kfree_skb: skbaddr=da66f900 protocol=2048 location=c1365429
          <idle>-0     [000] 60193.493933: kfree_skb: skbaddr=deaeb480 protocol=4 location=c134ec25
          <idle>-0     [000] 60253.118421: kfree_skb: skbaddr=de7c4900 protocol=4 location=c134ec25

After patch:

            bash-2587  [001] 97685.781173: kfree_skb: skbaddr=deb9cc00 protocol=0x0000 location=netlink_unicast
            bash-2587  [000] 97686.501121: kfree_skb: skbaddr=df9bb840 protocol=0x0000 location=netlink_unicast
          <idle>-0     [000] 97696.200184: kfree_skb: skbaddr=df741240 protocol=0x0800 location=ip_rcv
          <idle>-0     [000] 97696.200198: kfree_skb: skbaddr=dfb3de40 protocol=0x0800 location=ip_rcv
---
 include/trace/events/skb.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 include/trace/events/skb.h
include/trace/events/skb.h +0 -0
old mode 100644
new mode 100755
index 1e8fabb..a58bef8

include/trace/events/skb.h TRACE_EVENT(kfree_skb, · line 35

Quoted 7 lines
include/trace/events/skb.h +1 -1
@@ -30,7 +30,7 @@ TRACE_EVENT(kfree_skb,
 		__entry->location = location;
 	),
 
-	TP_printk("skbaddr=%p protocol=%u location=%p",
+	TP_printk("skbaddr=%p protocol=0x%04X location=%pf",
 		__entry->skbaddr, __entry->protocol, __entry->location)
 );

No objection to the code change, but whats with the new mode? Why are you making the file executable?

Neil

#2 lore raw
Quoted 4 lines · Neil Horman

No objection to the code change, but whats with the new mode? Why are you making the file executable?

Hi Neil:

Thanks for your review, this is my mistake, I'll fix it in v2 patch.

Thanks,
Xiao Guangrong

Quoted 4 lines

Neil