Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1722929rwo; Wed, 2 Aug 2023 20:57:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlFi9hGre6+Wj+i142kLOvSi1Laf3PnCsC0SgDyhMUBxy+qkwU39bN0YJ4yycWfx/LVFCgKK X-Received: by 2002:aa7:c795:0:b0:522:2c44:a915 with SMTP id n21-20020aa7c795000000b005222c44a915mr6895201eds.24.1691035067831; Wed, 02 Aug 2023 20:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691035067; cv=none; d=google.com; s=arc-20160816; b=yw9y32eFBRBT8J9F/i4igHT5oovVhM6G0spweiag8YelaInQboqaePeXD5WEdKEuVb +027c01elQt+tzzMn8xwOiUC3TNZezN1AC9HgOfpxmVvz7t7NXApaDAyIrGACWzxwMLw 3DAwfK2h9Fn0NrgQVOh58yp0deq6lh6zAW/wQLsh/q9lq6gwgbvEclGOSDzjTedmcGyE YTfzWZ7S8ZcB7WIjG43cgy/HeeAJz5We6aCs5k6k0JBXsKqv299HH9bwzYXEVBOW8GgP Gm0zRakicfMOJBeEuv/aZJz0QNkmQ9ZKZ0tnTPnIVeVn0XN8B9WZpvZmoKByW8kKurHl ZqqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=OcK6gslx0LoIyGj+/TpyBsBC+gruy1kemhKkiJB+8W8=; fh=Oht4GR3B1b7NI21IyLQZIButLBGV9Tz7mVypv5Sb+0Q=; b=UzXPS5KMETCohS044VmDxO61h2sYcmIfqk165JYm3Id16GwhBVqXlPntvEtC8C59Ka 3oHJ28D57RxzsXl2Mvo904SGazHiQeWjjpDIRMH/rI33TiJ/nQIJF7V0QpueIaZOBOyj JBtf/9qe9XkBuS3j9VE2hK45zmI1E+PKB2GlQzaMR3i/L+slObbct8R5C66dYuBFi08h +z6vgKVjSTjiAfzp20tHBXFs/r2PAS0/AciQ+LPd2imPERYC8KttAE9lf+QAkBWhlN2l FblM8OLxsvpt5ELZ/OoMeq7d0x/evIz6sWxHKZB6kUIxwGkSpJ2DWVTQVHypvajRVtBV IuzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RPwVsk4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p21-20020aa7d315000000b0052228ec4a89si10762315edq.65.2023.08.02.20.57.17; Wed, 02 Aug 2023 20:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RPwVsk4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbjHCCCW (ORCPT + 99 others); Wed, 2 Aug 2023 22:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjHCCCU (ORCPT ); Wed, 2 Aug 2023 22:02:20 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F219C13E; Wed, 2 Aug 2023 19:02:17 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fe48d0ab0fso740230e87.1; Wed, 02 Aug 2023 19:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691028136; x=1691632936; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=OcK6gslx0LoIyGj+/TpyBsBC+gruy1kemhKkiJB+8W8=; b=RPwVsk4sOj2Nq+sKh3qHWv5DoD9cfQy6DEJ0Xn0EP9Ohsx5uqkXr1sq33B4R0hQlcm nn50Nxo6gN8AfE1bLB+54DPKFLHRswl4IRGMJF4eAwBbggUrk6pOzAYTn0ypCFTsIhgU mmnLiPjuzQNEOWw7esUMP3kfC01KdQYe8d1l3lDrFckvKr6nd26cL0f0ZU/S0Wo94j27 7ZH14DzJuuQ0RCMRZhA/3ZodUUQW5SRRVCHptEXjUIyl7HI0RoljhkDoYbPcb0KuGR8t Ube0htK2aiilLm6tlCcF8gQcBgStQ0Bi8GhhrwneXS+YwmDhwdASPvV75e+cN24bIVzY lk4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691028136; x=1691632936; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OcK6gslx0LoIyGj+/TpyBsBC+gruy1kemhKkiJB+8W8=; b=NX4dP+Q/0iOmImVpT+4RBHsWPGe3Nd7QX4Ut18Q355buO5g8NDS0a4dVnigUWyqolP rnnZGluaiKr2KM4ajluvslb9+ShfElArz6ZsfH4wsPhkj/qFLbZIi6crtzzwWgAy1ZPb qNAqEdqwE3ZWgVGeTI80OL3VkkmP/NB1WK6zrdU9bNtl7OLiBXpsm+P83pwlNAUlo8Cj Mzy5ES1jm410mvhwJzBoka3T7FM6vN8autmBvQBA/G8anMd8S70CrVMPEXLtEhAsIp5s F6K9OIDD2GyuM/DC55CyK2+wqKGbWi9qcw5HoCiSzAU9p1Cr7vISntu4WZUeNV5xZ6ds H65Q== X-Gm-Message-State: ABy/qLYzbATFHJzx7svClVE7WWzt0J/DdxQODnVZK3wTZ+LqoBzy7DGq wfBAR5RAxrq4P3Sgod0fgw85juLoJbKlcuTl6wU= X-Received: by 2002:a19:384d:0:b0:4f7:6685:2c5f with SMTP id d13-20020a19384d000000b004f766852c5fmr5164267lfj.61.1691028135872; Wed, 02 Aug 2023 19:02:15 -0700 (PDT) MIME-Version: 1.0 References: <20230802121116.324604-1-zegao@tencent.com> <20230802121116.324604-5-zegao@tencent.com> <20230802110552.768f0487@gandalf.local.home> In-Reply-To: <20230802110552.768f0487@gandalf.local.home> From: Ze Gao Date: Thu, 3 Aug 2023 10:02:04 +0800 Message-ID: Subject: Re: [RFC PATCH v4 4/7] sched, tracing: reorganize fields of switch event struct To: Steven Rostedt Cc: Adrian Hunter , Alexander Shishkin , Arnaldo Carvalho de Melo , Ian Rogers , Ingo Molnar , Jiri Olsa , Mark Rutland , Masami Hiramatsu , Namhyung Kim , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org, Ze Gao Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 2, 2023 at 11:05=E2=80=AFPM Steven Rostedt wrote: > > On Wed, 2 Aug 2023 08:09:59 -0400 > Ze Gao wrote: > > > From: Ze Gao > > > > Report priorities in 'short' and prev_state in 'int' to save > > some buffer space. And also reorder the fields so that we take > > struct alignment into consideration to make the record compact. > > > > Suggested-by: Steven Rostedt (Google) > > Signed-off-by: Ze Gao > > --- > > include/trace/events/sched.h | 24 ++++++++++++------------ > > 1 file changed, 12 insertions(+), 12 deletions(-) > > > > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.= h > > index fbb99a61f714..7d34db20b2c6 100644 > > --- a/include/trace/events/sched.h > > +++ b/include/trace/events/sched.h > > @@ -187,7 +187,7 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_ne= w, > > TP_ARGS(p)); > > > > #ifdef CREATE_TRACE_POINTS > > -static inline long __trace_sched_switch_state(bool preempt, > > +static inline int __trace_sched_switch_state(bool preempt, > > unsigned int prev_state, > > struct task_struct *p) > > { > > @@ -229,23 +229,23 @@ TRACE_EVENT(sched_switch, > > TP_ARGS(preempt, prev, next, prev_state), > > > > TP_STRUCT__entry( > > - __array( char, prev_comm, TASK_COMM_LEN ) > > __field( pid_t, prev_pid ) > > - __field( int, prev_prio ) > > - __field( long, prev_state ) > > - __array( char, next_comm, TASK_COMM_LEN ) > > __field( pid_t, next_pid ) > > - __field( int, next_prio ) > > + __field( short, prev_prio ) > > + __field( short, next_prio ) > > + __field( int, prev_state ) > > I was talking with Peter on IRC and since the biggest number that > prev_state can be is TASK_REPORT_MASK which is 0x100, I think we can make > prev_state into a short as well. Make sense, let's change it to short. Regards, Ze