From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbdI2NAN (ORCPT ); Fri, 29 Sep 2017 09:00:13 -0400 Received: from smtprelay0101.hostedemail.com ([216.40.44.101]:50131 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752250AbdI2NAL (ORCPT ); Fri, 29 Sep 2017 09:00:11 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3872:3874:5007:6261:7875:7974:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12663:12740:12760:12895:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:21325:21451:21627:30045:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: star03_1384dacd8c4d X-Filterd-Recvd-Size: 2580 Date: Fri, 29 Sep 2017 09:00:04 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: mingo@kernel.org, markus@trippelsdorf.de, tj@kernel.org, mcgrof@kernel.org, ebiederm@xmission.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] sched: Consistent task-state printing Message-ID: <20170929090004.370084e9@vmware.local.home> In-Reply-To: <20170929115016.pzlqc7ss3ccystyg@hirez.programming.kicks-ass.net> References: <20170925120747.125098571@infradead.org> <20170925121116.927982688@infradead.org> <20170925160109.0086eccb@vmware.local.home> <20170929115016.pzlqc7ss3ccystyg@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Sep 2017 13:50:16 +0200 Peter Zijlstra wrote: > On Mon, Sep 25, 2017 at 04:01:09PM -0400, Steven Rostedt wrote: > > On Mon, 25 Sep 2017 14:07:48 +0200 > > Peter Zijlstra wrote: > > > > > +static inline char __task_state_to_char(unsigned int state) > > > +{ > > > + static const char state_char[] = "RSDTtXZ"; > > > + > > > + BUILD_BUG_ON(1 + ilog2(TASK_REPORT) != sizeof(state_char) - 2); > > > > > > - return state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'; > > > + return state_char[state]; > > > +} > > > + > > > +static inline char task_state_to_char(struct task_struct *tsk) > > > +{ > > > + return __task_state_to_char(__get_task_state(tsk)); > > > } > > > > > > > So far I'm fine with the patch set, but I hate the non descriptive "__" > > prefix of __task_state_to_char(). Can we make this a bit more > > descriptive, because every time I see it in other patches, I go back to > > this patch to see if we are using the right function. > > > > What about something like: > > > > task_state_to_state_char(unsigned int state); > > > > task_to_state_char(struct task_struct *tsk); > > > > ? > > Hurmph.. naming. > > How about something like so? > I'm not picky, I just hate beginning underscores, and wish we can start removing all functions that use them. Acked-by: Steven Rostedt (VMware) -- Steve