From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC5CFC35656 for ; Fri, 21 Feb 2020 15:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D04E24656 for ; Fri, 21 Feb 2020 15:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbgBUPt0 (ORCPT ); Fri, 21 Feb 2020 10:49:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:41176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728235AbgBUPtZ (ORCPT ); Fri, 21 Feb 2020 10:49:25 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C69B024650; Fri, 21 Feb 2020 15:49:24 +0000 (UTC) Date: Fri, 21 Feb 2020 10:49:22 -0500 From: Steven Rostedt To: Jiri Olsa Cc: linux-rt-users@vger.kernel.org, Thomas Gleixner , Juri Lelli , Sebastian Sewior , Arnaldo Carvalho de Melo Subject: Re: [PATCH] tracing: Fix trace entry and trace common fields for preempt_lazy_count Message-ID: <20200221104922.5ea8bb5f@gandalf.local.home> In-Reply-To: <20200221153541.681468-1-jolsa@kernel.org> References: <20200221153541.681468-1-jolsa@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org On Fri, 21 Feb 2020 16:35:41 +0100 Jiri Olsa wrote: > When commit 65fd07df3588 added preempt_lazy_count into 'struct trace_entry' > it did not add 4 bytes padding. Also we need to update the common fields > for tracepoint, otherwise some tools (bpftrace) stop working due to missing > common fields. > > Fixes: 65fd07df3588 ("x86: Support for lazy preemption") > Signed-off-by: Jiri Olsa > --- > include/linux/trace_events.h | 2 ++ > kernel/trace/trace_events.c | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h > index f3b1ef07e4a5..51a3f5188923 100644 > --- a/include/linux/trace_events.h > +++ b/include/linux/trace_events.h > @@ -65,6 +65,8 @@ struct trace_entry { > unsigned short migrate_disable; > unsigned short padding; > unsigned char preempt_lazy_count; > + unsigned char padding1; > + unsigned short padding2; Wait! I don't have these changes in my tree, nor do I see them in Linus's. This really bloats the trace events! This header is very sensitive to size and just willy nilly adding to it is unacceptable. It's like adding to the page_struct. This gets added to *every* event, and a single byte added, causes 1M extra for a million events (very common in tracing). It causes 1G extra for a billion events. Let's find a better way to handle this. -- Steve > }; > > #define TRACE_EVENT_TYPE_MAX \ > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c > index accaae59a762..1fe37b7aeaff 100644 > --- a/kernel/trace/trace_events.c > +++ b/kernel/trace/trace_events.c > @@ -183,6 +183,9 @@ static int trace_define_common_fields(void) > __common_field(int, pid); > __common_field(unsigned short, migrate_disable); > __common_field(unsigned short, padding); > + __common_field(unsigned char, preempt_lazy_count); > + __common_field(unsigned char, padding1); > + __common_field(unsigned short, padding2); > > return ret; > }