All of lore.kernel.org
 help / color / mirror / Atom feed
* perf probe and bitfields
@ 2018-01-19 16:43 David Ahern
  2018-01-26  6:56 ` Namhyung Kim
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2018-01-19 16:43 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Masami Hiramatsu, Perf Users

Hi Arnaldo / Masami:

Are there known issues / limitations with perf probe and bitfields?

Here's an example: pkt_type is a bitfield in sk_buff. When I put a probe
in arp_rcv to examine the pkt_type value:

$ perf probe 'arp_rcv ptype=skb->pkt_type dev=dev->name:string'

I only get '0' output:

$ perf script
     vhost-27472 27483 [013] 4313207.619714: probe:arp_rcv:
(ffffffff815653b0) ptype=0 dev="br1"
     vhost-27472 27483 [013] 4313207.619763: probe:arp_rcv:
(ffffffff815653b0) ptype=0 dev="br1"
     vhost-27472 27483 [013] 4313210.588990: probe:arp_rcv:
(ffffffff815653b0) ptype=0 dev="br1"

when I know broadcast packet are getting handled (pkt_type ==
PACKET_BROADCAST). This is confirmed by adding a printk to arp_rcv.

Thanks,
David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: perf probe and bitfields
  2018-01-19 16:43 perf probe and bitfields David Ahern
@ 2018-01-26  6:56 ` Namhyung Kim
  2018-01-26 16:28   ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2018-01-26  6:56 UTC (permalink / raw)
  To: David Ahern
  Cc: Arnaldo Carvalho de Melo, Masami Hiramatsu, Perf Users, kernel-team

Hi David,

On Fri, Jan 19, 2018 at 08:43:50AM -0800, David Ahern wrote:
> Hi Arnaldo / Masami:
> 
> Are there known issues / limitations with perf probe and bitfields?
> 
> Here's an example: pkt_type is a bitfield in sk_buff. When I put a probe
> in arp_rcv to examine the pkt_type value:
> 
> $ perf probe 'arp_rcv ptype=skb->pkt_type dev=dev->name:string'

Bitfield type takes 3 parameters according to the Doc/perf-probe.txt.
Maybe it's like 'ptype=skb->pkt_type:b3@0/8' ?

Thanks,
Namhyung


> 
> I only get '0' output:
> 
> $ perf script
>      vhost-27472 27483 [013] 4313207.619714: probe:arp_rcv:
> (ffffffff815653b0) ptype=0 dev="br1"
>      vhost-27472 27483 [013] 4313207.619763: probe:arp_rcv:
> (ffffffff815653b0) ptype=0 dev="br1"
>      vhost-27472 27483 [013] 4313210.588990: probe:arp_rcv:
> (ffffffff815653b0) ptype=0 dev="br1"
> 
> when I know broadcast packet are getting handled (pkt_type ==
> PACKET_BROADCAST). This is confirmed by adding a printk to arp_rcv.
> 
> Thanks,
> David
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: perf probe and bitfields
  2018-01-26  6:56 ` Namhyung Kim
@ 2018-01-26 16:28   ` David Ahern
  2018-01-27  5:04     ` Masami Hiramatsu
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2018-01-26 16:28 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Masami Hiramatsu, Perf Users, kernel-team

On 1/25/18 11:56 PM, Namhyung Kim wrote:
> Hi David,
> 
> On Fri, Jan 19, 2018 at 08:43:50AM -0800, David Ahern wrote:
>> Hi Arnaldo / Masami:
>>
>> Are there known issues / limitations with perf probe and bitfields?
>>
>> Here's an example: pkt_type is a bitfield in sk_buff. When I put a probe
>> in arp_rcv to examine the pkt_type value:
>>
>> $ perf probe 'arp_rcv ptype=skb->pkt_type dev=dev->name:string'
> 
> Bitfield type takes 3 parameters according to the Doc/perf-probe.txt.
> Maybe it's like 'ptype=skb->pkt_type:b3@0/8' ?

missed that. Thanks, Namyhung.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: perf probe and bitfields
  2018-01-26 16:28   ` David Ahern
@ 2018-01-27  5:04     ` Masami Hiramatsu
  2018-01-30 16:53       ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2018-01-27  5:04 UTC (permalink / raw)
  To: David Ahern
  Cc: Namhyung Kim, Arnaldo Carvalho de Melo, Masami Hiramatsu,
	Perf Users, kernel-team

On Fri, 26 Jan 2018 09:28:49 -0700
David Ahern <dsahern@gmail.com> wrote:

> On 1/25/18 11:56 PM, Namhyung Kim wrote:
> > Hi David,
> > 
> > On Fri, Jan 19, 2018 at 08:43:50AM -0800, David Ahern wrote:
> >> Hi Arnaldo / Masami:
> >>
> >> Are there known issues / limitations with perf probe and bitfields?
> >>
> >> Here's an example: pkt_type is a bitfield in sk_buff. When I put a probe
> >> in arp_rcv to examine the pkt_type value:
> >>
> >> $ perf probe 'arp_rcv ptype=skb->pkt_type dev=dev->name:string'
> > 
> > Bitfield type takes 3 parameters according to the Doc/perf-probe.txt.
> > Maybe it's like 'ptype=skb->pkt_type:b3@0/8' ?
> 
> missed that. Thanks, Namyhung.



Hmm, if you have debuginfo, it must be automatically translated.
E.g.

$ sudo perf probe -D "arp_rcv ptype=skb->pkt_type dev=dev->name:string"
p:probe/arp_rcv _text+8135904 ptype=+144(%di):b3@5/8 dev=+0(%si):string

So as you can see the ptype automatically has ":b3@5/8" types.

Thanks,

-- 
Masami Hiramatsu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: perf probe and bitfields
  2018-01-27  5:04     ` Masami Hiramatsu
@ 2018-01-30 16:53       ` David Ahern
  0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2018-01-30 16:53 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Namhyung Kim, Arnaldo Carvalho de Melo, Masami Hiramatsu,
	Perf Users, kernel-team

On 1/26/18 10:04 PM, Masami Hiramatsu wrote:
> On Fri, 26 Jan 2018 09:28:49 -0700
> David Ahern <dsahern@gmail.com> wrote:
> 
>> On 1/25/18 11:56 PM, Namhyung Kim wrote:
>>> Hi David,
>>>
>>> On Fri, Jan 19, 2018 at 08:43:50AM -0800, David Ahern wrote:
>>>> Hi Arnaldo / Masami:
>>>>
>>>> Are there known issues / limitations with perf probe and bitfields?
>>>>
>>>> Here's an example: pkt_type is a bitfield in sk_buff. When I put a probe
>>>> in arp_rcv to examine the pkt_type value:
>>>>
>>>> $ perf probe 'arp_rcv ptype=skb->pkt_type dev=dev->name:string'
>>>
>>> Bitfield type takes 3 parameters according to the Doc/perf-probe.txt.
>>> Maybe it's like 'ptype=skb->pkt_type:b3@0/8' ?
>>
>> missed that. Thanks, Namyhung.
> 
> 
> 
> Hmm, if you have debuginfo, it must be automatically translated.
> E.g.
> 
> $ sudo perf probe -D "arp_rcv ptype=skb->pkt_type dev=dev->name:string"
> p:probe/arp_rcv _text+8135904 ptype=+144(%di):b3@5/8 dev=+0(%si):string
> 
> So as you can see the ptype automatically has ":b3@5/8" types.

I was expecting it to automatically figure that out. The kernels in
question were custom built and the vmlinux must not have been available.

Thanks the tip.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-01-30 16:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 16:43 perf probe and bitfields David Ahern
2018-01-26  6:56 ` Namhyung Kim
2018-01-26 16:28   ` David Ahern
2018-01-27  5:04     ` Masami Hiramatsu
2018-01-30 16:53       ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.