From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [bpf-next PATCH 3/3] bpf: add sample program to trace map events Date: Thu, 19 Apr 2018 11:20:04 +0200 Message-ID: <20180419112004.5eb67a84@redhat.com> References: <152406544226.3465.948692097697975172.stgit@localhost.localdomain> <152406545918.3465.14253635905960610284.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, mingo@redhat.com, rostedt@goodmis.org, fulvio.risso@polito.it, brouer@redhat.com To: Sebastiano Miano Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751092AbeDSJUI (ORCPT ); Thu, 19 Apr 2018 05:20:08 -0400 In-Reply-To: <152406545918.3465.14253635905960610284.stgit@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 18 Apr 2018 17:30:59 +0200 Sebastiano Miano wrote: > This patch adds a sample program, called trace_map_events, > that shows how to capture map events and filter them based on > the map id. > > The program accepts a list of map IDs, via the -i command line > option, and filters all the map events related to those IDs (i.e., > map_create/update/lookup/next_key). > If no IDs are specified, all map events are listed and no filtering > is performed. > > Sample usage: > > # trace_map_events -i -i -i ... > > Signed-off-by: Sebastiano Miano Acked-by: Jesper Dangaard Brouer I have tested it works: $ sudo ./trace_map_events -i 2 Init bpf_perf_event for cpu:0 Init bpf_perf_event for cpu:1 Init bpf_perf_event for cpu:2 Init bpf_perf_event for cpu:3 Init bpf_perf_event for cpu:4 Init bpf_perf_event for cpu:5 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... LOOKUP event for map id: 2 and type: 6 Waiting for map events... -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer