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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED 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 93B90C433F5 for ; Wed, 5 Sep 2018 12:23:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E84F20857 for ; Wed, 5 Sep 2018 12:23:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E84F20857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbeIEQxF convert rfc822-to-8bit (ORCPT ); Wed, 5 Sep 2018 12:53:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:42912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbeIEQxE (ORCPT ); Wed, 5 Sep 2018 12:53:04 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 EFBE620659; Wed, 5 Sep 2018 12:23:02 +0000 (UTC) Date: Wed, 5 Sep 2018 08:23:01 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Ingo Molnar , Sebastian Andrzej Siewior , Thomas Gleixner , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] sched/debug: use symbolic names for task state constants Message-ID: <20180905082301.131e1967@gandalf.local.home> In-Reply-To: <20180905112524.GU24082@hirez.programming.kicks-ass.net> References: <20180905093636.24068-1-u.kleine-koenig@pengutronix.de> <20180905112524.GU24082@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Sep 2018 13:25:24 +0200 Peter Zijlstra wrote: > On Wed, Sep 05, 2018 at 11:36:36AM +0200, Uwe Kleine-König wrote: > > include/trace/events/sched.h includes (via > > ) and so knows about the TASK_* constants > > used to interpret .prev_state. So instead of duplicating the magic > > numbers make use of the defined macros to ease understanding the > > mapping from state bits to letters which isn't completely intuitive for > > an outsider. > > > > Signed-off-by: Uwe Kleine-König > > --- > > include/trace/events/sched.h | 11 ++++++++--- > > 1 file changed, 8 insertions(+), 3 deletions(-) > > > > diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h > > index 0be866c91f62..f07b270d4fc4 100644 > > --- a/include/trace/events/sched.h > > +++ b/include/trace/events/sched.h > > @@ -159,9 +159,14 @@ TRACE_EVENT(sched_switch, > > > > (__entry->prev_state & (TASK_REPORT_MAX - 1)) ? > > __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|", > > - { 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" }, > > - { 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" }, > > - { 0x40, "P" }, { 0x80, "I" }) : > > + { TASK_INTERRUPTIBLE, "S" }, > > + { TASK_UNINTERRUPTIBLE, "D" }, > > + { __TASK_STOPPED, "T" }, > > + { __TASK_TRACED, "t" }, > > + { EXIT_DEAD, "X" }, > > + { EXIT_ZOMBIE, "Z" }, > > + { TASK_PARKED, "P" }, > > + { TASK_DEAD, "I" }) : > > "R", > > Steve, does this work? As long as the text is preprocessor macros (which they appear to be), then yeah, this shouldn't cause any harm. If they were enums, then it would require a little more work. -- Steve