From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753215AbbDBCMe (ORCPT ); Wed, 1 Apr 2015 22:12:34 -0400 Received: from mail.kernel.org ([198.145.29.136]:33810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbbDBCJr (ORCPT ); Wed, 1 Apr 2015 22:09:47 -0400 Message-Id: <20150402020941.597759903@goodmis.org> User-Agent: quilt/0.61-1 Date: Wed, 01 Apr 2015 21:56:58 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Namhyung Kim , Masami Hiramatsu , Mathieu Desnoyers , Dave Hansen Subject: [RFC][PATCH 10/17 v2] x86/tlb/trace: Export enums in used by tlb_flush tracepoint References: <20150402015648.249824760@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=0010-x86-tlb-trace-Export-enums-in-used-by-tlb_flush-trac.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Steven Rostedt (Red Hat)" Have the enums used in __print_symbolic() by the trace_tlb_flush() tracepoint exported to userpace such that they can be parsed by userspace tools. Cc: Dave Hansen Signed-off-by: Steven Rostedt --- include/trace/events/tlb.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h index 0e7635765153..4250f364a6ca 100644 --- a/include/trace/events/tlb.h +++ b/include/trace/events/tlb.h @@ -7,11 +7,31 @@ #include #include -#define TLB_FLUSH_REASON \ - { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" }, \ - { TLB_REMOTE_SHOOTDOWN, "remote shootdown" }, \ - { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \ - { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" } +#define TLB_FLUSH_REASON \ + EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \ + EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \ + EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \ + EMe( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) + +/* + * First define the enums in TLB_FLUSH_REASON to be exported to userspace + * via TRACE_DEFINE_ENUM(). + */ +#undef EM +#undef EMe +#define EM(a,b) TRACE_DEFINE_ENUM(a); +#define EMe(a,b) TRACE_DEFINE_ENUM(a); + +TLB_FLUSH_REASON + +/* + * Now redefine the EM() and EMe() macros to map the enums to the strings + * that will be printed in the output. + */ +#undef EM +#undef EMe +#define EM(a,b) { a, b }, +#define EMe(a,b) { a, b } TRACE_EVENT_CONDITION(tlb_flush, -- 2.1.4