Message ID | 20230803083352.1585-4-zegao@tencent.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp1006114vqx; Thu, 3 Aug 2023 01:56:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlFQbwu4QscYvZOnFQOB52kg2txDdsc/1Qd4FHnOhRyk8t1EC3/quRIMtjtfYSeLvIboBPXw X-Received: by 2002:a05:6a00:18a5:b0:668:6eed:7c12 with SMTP id x37-20020a056a0018a500b006686eed7c12mr20361790pfh.22.1691052975852; Thu, 03 Aug 2023 01:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691052975; cv=none; d=google.com; s=arc-20160816; b=yIOpHOAnkoYO4hC9Wf7YWOdB5gOVOcByIGjPdop7ouIB5dEmjEWQsifoGjYxu+hmh7 w2i6KEZ+CinDCLWpDdQoRLxFq5ZJjc+1oH8MNWQ/g0U/axaXc64W6+4WhwVcGF8JGBsk u/6VG3OkdDojBm6awlu4HpFhZAflFqlgUuLFaLnHmnyl6+PNg5zWxWUzYVJVc9iZeqHO f+ddhnsbhkyTdaO9bTEkiL2E0c85+2+bIwgPWzE3nS9sO8x1SnGFe59ZXDkExaCl2cD8 BeyY3zXYo+X0AsL9qIUAHKxmZxTnvCBSKxzLMJeTk2VrKTY/9kda5XsJIHJGuWKlSqxZ nYEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=coQVZUIdITCOzeysZQXt4l056xN3FXYmzJxiupx3WHw=; fh=TgT5K4Z1kLXalrYfkT8XvOWNi122otFfxWyimjdT30Y=; b=GvZcJQ6byg3Xf25pNlkYNqb/Kg3f3EdnkZt4JBagTuDMsTbQTb/5WXcSoMZzhCYfdV 9SBhVHP4cumdn8zHECgbd32rfFJLxbVcuywAtQO/Ld2nsjGwDxCnkd3FN+WmFzaOG822 CkTzUChHOfW3klhQI9OV7R06yazlwdA+VVWvtBqLltlws+OTZe2IJsZu6hKjL5QFQm/b t+3kI5kzQbL43lq4xziEPiISF7+wbCtPHiHSrbkEYIzbv99+npUBjx/sk4szj9bBxnvU H348IlBKY4irzqPpw8pukLjRrsmEMf68mosuLmE1YrfGoK+IjZX+uW+jQRv4vrM22kPY NbOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=od4Z3nXk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a63d043000000b00563e1deea73si11801137pgi.39.2023.08.03.01.56.01; Thu, 03 Aug 2023 01:56:15 -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=od4Z3nXk; 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 S231717AbjHCIgt (ORCPT <rfc822;jeff.pang.chn@gmail.com> + 99 others); Thu, 3 Aug 2023 04:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234556AbjHCIgV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Aug 2023 04:36:21 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04D8611F; Thu, 3 Aug 2023 01:34:51 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-56ca1eebcd7so444841eaf.0; Thu, 03 Aug 2023 01:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691051690; x=1691656490; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=coQVZUIdITCOzeysZQXt4l056xN3FXYmzJxiupx3WHw=; b=od4Z3nXkFb2ruxjbXhUVYjA7VEjNrqjYqVRfIWS4yENSZ8YyawxHk2gFaODut66GXi QMTLtpTHRHlLrjWPtfIvFQi0PbNH0B5RIBnQtyj/b4q1EaH4jEMdWhjpA4b7nxqrQBKR QBoQg/tsr5ZgXitzUD83Z/iYAnREuTa6EyqFtthFCk/sclpqULlSbCgD4SZPEpTA4nME x2Ot8A/KIsWlmnExXdAoZcEb2erX23ziDZa7TXn0KIEqzR8QHyjyAVqquyHz16YiTggQ teiKO3JIyKUoxwD8raxR2CHSTK6MtBT1MwQcvh3G4fEHzDD1ctomVvlGYFKs36QoZJ70 BeHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691051690; x=1691656490; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=coQVZUIdITCOzeysZQXt4l056xN3FXYmzJxiupx3WHw=; b=YMw8VeSAqm1Yg2Cau3mhyQ60YlI4Cb5f0jq/RD6nfjhWrMuBS77CRy43ZDJ3c4ewnX qVwGezDkvW38hR9H3lagIZT1E4XsZsOhUkmSMPNTYy4dUe0qRqJbmE0J049/RhTYMry1 cOt6c7h1+LskQAw9Yp1DhQuNaBmc0q/bqrHTIxmxs7JGbGpHUWbjFUmwIDldzge1FVWJ 5yrcE4HTuS9cY/G82t+SF8HGWNY6iCQemcA963szCsdwdlPQjrCquWcpAIN85wZjsYhT 73ZFlxUN146E203bBQCB9b0DpVu1sSTXo74IQhILEXP8mmLwPrgQsMKGY2VSqvbBa96t QyGA== X-Gm-Message-State: ABy/qLYAsoeZZtRfcdRk55lVHCMBzDo834tbVDtA9TevKd7En9bqeEHB jMQpggKlUmF5Mwj6K1a23wY= X-Received: by 2002:a05:6358:e499:b0:139:d226:b361 with SMTP id by25-20020a056358e49900b00139d226b361mr8646644rwb.31.1691051690070; Thu, 03 Aug 2023 01:34:50 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.83]) by smtp.googlemail.com with ESMTPSA id r6-20020a63b106000000b00563feb7113dsm12541876pgf.91.2023.08.03.01.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 01:34:49 -0700 (PDT) From: Ze Gao <zegao2021@gmail.com> X-Google-Original-From: Ze Gao <zegao@tencent.com> To: Adrian Hunter <adrian.hunter@intel.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Ian Rogers <irogers@google.com>, Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Masami Hiramatsu <mhiramat@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Steven Rostedt <rostedt@goodmis.org> Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Ze Gao <zegao@tencent.com> Subject: [RFC PATCH v6 3/5] sched, tracing: reorganize fields of switch event struct Date: Thu, 3 Aug 2023 04:33:50 -0400 Message-ID: <20230803083352.1585-4-zegao@tencent.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230803083352.1585-1-zegao@tencent.com> References: <20230803083352.1585-1-zegao@tencent.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_BLOCKED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773197565408170594 X-GMAIL-MSGID: 1773197565408170594 |
Series |
fix task state report from sched tracepoint
|
|
Commit Message
Ze Gao
Aug. 3, 2023, 8:33 a.m. UTC
Report prioritiy and prev_state in 'short' 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) <rostedt@goodmis.org>
Signed-off-by: Ze Gao <zegao@tencent.com>
---
include/trace/events/sched.h | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
Comments
On Thu, Aug 03, 2023 at 04:33:50AM -0400, Ze Gao wrote: > Report prioritiy and prev_state in 'short' 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) <rostedt@goodmis.org> > Signed-off-by: Ze Gao <zegao@tencent.com> I am really getting fed up with this. This again doesn't list any reasons on why this is a sane thing to do. Please review past discussions and collate the various things mentioned into this Changelog.
On Thu, 3 Aug 2023 04:33:50 -0400 Ze Gao <zegao2021@gmail.com> wrote: > Report prioritiy and prev_state in 'short' to save some buffer > space. And also reorder the fields so that we take struct > alignment into consideration to make the record compact. If I were to write this, I would have wrote: The prev_state field in the sched_switch event is assigned by __trace_sched_switch_state(). The largest number that function will return is TASK_REPORT_MAX which is just 0x100. There's no reason that the prev_state field is a full 32 bits when it is using just 9 bits max. In order to save space on the ring buffer, shrink the prev_state to 16 bits (short). Also, change the positions of the other fields to accommodate the short value of prev_state to eliminate any holes that were created in the structure. See the difference? > > #ifdef CREATE_TRACE_POINTS > -static inline long __trace_sched_switch_state(bool preempt, > +static inline short __trace_sched_switch_state(bool preempt, > unsigned int prev_state, > struct task_struct *p) > { > unsigned int state; > > #ifdef CONFIG_SCHED_DEBUG > - BUG_ON(p != current); > + WARN_ON_ONCE(p != current); > #endif /* CONFIG_SCHED_DEBUG */ The above needs to be a separate patch. -- Steve > > /* > @@ -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 ) > + __array( char, prev_comm, TASK_COMM_LEN ) > + __array( char, next_comm, TASK_COMM_LEN ) > + __field( short, prev_state ) > ), > > TP_fast_assign( > - memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > - __entry->prev_pid = prev->pid; > - __entry->prev_prio = prev->prio; > - __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > + __entry->prev_pid = prev->pid; > + __entry->next_pid = next->pid; > + __entry->prev_prio = (short) prev->prio; > + __entry->next_prio = (short) next->prio; > memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); > - __entry->next_pid = next->pid; > - __entry->next_prio = next->prio; > + memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > + __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > /* XXX SCHED_DEADLINE */ > ), >
On Thu, Aug 03, 2023 at 05:18:26AM -0400, Steven Rostedt wrote: > On Thu, 3 Aug 2023 04:33:50 -0400 > Ze Gao <zegao2021@gmail.com> wrote: > > > Report prioritiy and prev_state in 'short' to save some buffer > > space. And also reorder the fields so that we take struct > > alignment into consideration to make the record compact. > > If I were to write this, I would have wrote: > > The prev_state field in the sched_switch event is assigned by > __trace_sched_switch_state(). The largest number that function will return > is TASK_REPORT_MAX which is just 0x100. There's no reason that the > prev_state field is a full 32 bits when it is using just 9 bits max. In > order to save space on the ring buffer, shrink the prev_state to 16 bits > (short). > > Also, change the positions of the other fields to accommodate the short > value of prev_state to eliminate any holes that were created in the > structure. > > See the difference? This also doesn't mention you broke the data format for all trace events a while back to ensure people are using libtracefs and are thus confident this won't break things.
On Thu, Aug 3, 2023 at 4:54 PM Peter Zijlstra <peterz@infradead.org> wrote: > > On Thu, Aug 03, 2023 at 04:33:50AM -0400, Ze Gao wrote: > > Report prioritiy and prev_state in 'short' 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) <rostedt@goodmis.org> > > Signed-off-by: Ze Gao <zegao@tencent.com> > > I am really getting fed up with this. This again doesn't list any > reasons on why this is a sane thing to do. Lesson learned from Steven's reply, Will reorganize the changelog. Thanks for pointing this out. Regards, Ze
On Thu, Aug 3, 2023 at 5:18 PM Steven Rostedt <rostedt@goodmis.org> wrote: > > On Thu, 3 Aug 2023 04:33:50 -0400 > Ze Gao <zegao2021@gmail.com> wrote: > > > Report prioritiy and prev_state in 'short' to save some buffer > > space. And also reorder the fields so that we take struct > > alignment into consideration to make the record compact. > > If I were to write this, I would have wrote: > > The prev_state field in the sched_switch event is assigned by > __trace_sched_switch_state(). The largest number that function will return > is TASK_REPORT_MAX which is just 0x100. There's no reason that the > prev_state field is a full 32 bits when it is using just 9 bits max. In > order to save space on the ring buffer, shrink the prev_state to 16 bits > (short). > > Also, change the positions of the other fields to accommodate the short > value of prev_state to eliminate any holes that were created in the > structure. > > See the difference? > > > > > #ifdef CREATE_TRACE_POINTS > > -static inline long __trace_sched_switch_state(bool preempt, > > +static inline short __trace_sched_switch_state(bool preempt, > > unsigned int prev_state, > > struct task_struct *p) > > { > > unsigned int state; > > > > #ifdef CONFIG_SCHED_DEBUG > > - BUG_ON(p != current); > > + WARN_ON_ONCE(p != current); > > #endif /* CONFIG_SCHED_DEBUG */ > > The above needs to be a separate patch. I've moved this to a new patch, and this is the changelog: sched, tracing: change BUG_ON to WARN_ON_ONCE in __trace_sched_switch_state BUG_ON() was introduced in 2014 and old, and we switch it to WARN_ON_ONCE() to not to crash the kernel when the sched-out task is unexpected than the current, as suggested by Steven. Signed-off-by: Ze Gao <zegao@tencent.com> Regards, Ze > > > > /* > > @@ -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 ) > > + __array( char, prev_comm, TASK_COMM_LEN ) > > + __array( char, next_comm, TASK_COMM_LEN ) > > + __field( short, prev_state ) > > ), > > > > TP_fast_assign( > > - memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > > - __entry->prev_pid = prev->pid; > > - __entry->prev_prio = prev->prio; > > - __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > > + __entry->prev_pid = prev->pid; > > + __entry->next_pid = next->pid; > > + __entry->prev_prio = (short) prev->prio; > > + __entry->next_prio = (short) next->prio; > > memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); > > - __entry->next_pid = next->pid; > > - __entry->next_prio = next->prio; > > + memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > > + __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > > /* XXX SCHED_DEADLINE */ > > ), > > >
On Thu, Aug 3, 2023 at 5:18 PM Steven Rostedt <rostedt@goodmis.org> wrote: > > On Thu, 3 Aug 2023 04:33:50 -0400 > Ze Gao <zegao2021@gmail.com> wrote: > > > Report prioritiy and prev_state in 'short' to save some buffer > > space. And also reorder the fields so that we take struct > > alignment into consideration to make the record compact. > > If I were to write this, I would have wrote: > > The prev_state field in the sched_switch event is assigned by > __trace_sched_switch_state(). The largest number that function will return > is TASK_REPORT_MAX which is just 0x100. There's no reason that the > prev_state field is a full 32 bits when it is using just 9 bits max. In > order to save space on the ring buffer, shrink the prev_state to 16 bits > (short). > > Also, change the positions of the other fields to accommodate the short > value of prev_state to eliminate any holes that were created in the > structure. Thanks for this elaboration! But I see Peter have comments on this, I'll wait to see these resolved and then send my new changelog. Thanks, Ze > > > > #ifdef CREATE_TRACE_POINTS > > -static inline long __trace_sched_switch_state(bool preempt, > > +static inline short __trace_sched_switch_state(bool preempt, > > unsigned int prev_state, > > struct task_struct *p) > > { > > unsigned int state; > > > > #ifdef CONFIG_SCHED_DEBUG > > - BUG_ON(p != current); > > + WARN_ON_ONCE(p != current); > > #endif /* CONFIG_SCHED_DEBUG */ > > The above needs to be a separate patch. > > -- Steve > > > > > /* > > @@ -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 ) > > + __array( char, prev_comm, TASK_COMM_LEN ) > > + __array( char, next_comm, TASK_COMM_LEN ) > > + __field( short, prev_state ) > > ), > > > > TP_fast_assign( > > - memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > > - __entry->prev_pid = prev->pid; > > - __entry->prev_prio = prev->prio; > > - __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > > + __entry->prev_pid = prev->pid; > > + __entry->next_pid = next->pid; > > + __entry->prev_prio = (short) prev->prio; > > + __entry->next_prio = (short) next->prio; > > memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); > > - __entry->next_pid = next->pid; > > - __entry->next_prio = next->prio; > > + memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); > > + __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); > > /* XXX SCHED_DEADLINE */ > > ), > > >
On Thu, 3 Aug 2023 11:51:32 +0200 Peter Zijlstra <peterz@infradead.org> wrote: > > > > See the difference? > > This also doesn't mention you broke the data format for all trace events > a while back to ensure people are using libtracefs and are thus > confident this won't break things. It was the meta data that happened a while ago. As other events change all the time with this restriction (keeping field names around), I didn't realize that it was required for this change log. Doesn't hurt adding it. More details on that: commit b000c8065 ("tracing: Remove the extra 4 bytes of padding in events") This was to get rid of the padding that powertop relied on. Nit, it's libtraceevent not libtracefs, as libtracefs gets you to the format files, but it's libtraceveent that parses them. -- Steve
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index fbb99a61f714..43492daefa6f 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -187,14 +187,14 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, TP_ARGS(p)); #ifdef CREATE_TRACE_POINTS -static inline long __trace_sched_switch_state(bool preempt, +static inline short __trace_sched_switch_state(bool preempt, unsigned int prev_state, struct task_struct *p) { unsigned int state; #ifdef CONFIG_SCHED_DEBUG - BUG_ON(p != current); + WARN_ON_ONCE(p != current); #endif /* CONFIG_SCHED_DEBUG */ /* @@ -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 ) + __array( char, prev_comm, TASK_COMM_LEN ) + __array( char, next_comm, TASK_COMM_LEN ) + __field( short, prev_state ) ), TP_fast_assign( - memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); - __entry->prev_pid = prev->pid; - __entry->prev_prio = prev->prio; - __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); + __entry->prev_pid = prev->pid; + __entry->next_pid = next->pid; + __entry->prev_prio = (short) prev->prio; + __entry->next_prio = (short) next->prio; memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); - __entry->next_pid = next->pid; - __entry->next_prio = next->prio; + memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); + __entry->prev_state = __trace_sched_switch_state(preempt, prev_state, prev); /* XXX SCHED_DEADLINE */ ),