Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761970AbbBJELk (ORCPT ); Mon, 9 Feb 2015 23:11:40 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.230]:47096 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754859AbbBJELi (ORCPT ); Mon, 9 Feb 2015 23:11:38 -0500 Date: Mon, 9 Feb 2015 23:12:16 -0500 From: Steven Rostedt To: Alexei Starovoitov Cc: Ingo Molnar , Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , linux-api@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 linux-trace 4/8] samples: bpf: simple tracing example in C Message-ID: <20150209231216.1b60f0cd@grimm.local.home> In-Reply-To: <1423539961-21792-5-git-send-email-ast@plumgrid.com> References: <1423539961-21792-1-git-send-email-ast@plumgrid.com> <1423539961-21792-5-git-send-email-ast@plumgrid.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1211 Lines: 35 On Mon, 9 Feb 2015 19:45:57 -0800 Alexei Starovoitov wrote: > +static void print_netif_receive_skb(void *data, int size) > +{ > + struct ftrace_raw_netif_receive_skb { > + struct trace_entry t; > + void *skb; > + __u32 len; > + __u32 name; > + } *e = data; Same here, there's no guarantee that this structure will always match. cat /sys/kernel/debug/tracing/events/net/netif_receive_skb/format name: netif_receive_skb ID: 975 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:void * skbaddr; offset:8; size:8; signed:0; field:unsigned int len; offset:16; size:4; signed:0; field:__data_loc char[] name; offset:20; size:4; signed:1; print fmt: "dev=%s skbaddr=%p len=%u", __get_str(name), REC->skbaddr, REC->len -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/