From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752612AbbF3GRm (ORCPT ); Tue, 30 Jun 2015 02:17:42 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:55901 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450AbbF3GRe (ORCPT ); Tue, 30 Jun 2015 02:17:34 -0400 X-Helo: d28dlp01.in.ibm.com X-MailFrom: naveen.n.rao@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Tue, 30 Jun 2015 11:46:49 +0530 From: "Naveen N. Rao" To: Srikar Dronamraju Cc: bsingharora@gmail.com, mingo@kernel.org, linux-kernel@vger.kernel.org, ricklind@us.ibm.com, a.p.zijlstra@chello.nl Subject: Re: [PATCH v2 2/2] schedstat: Expose /proc/pid/schedstat if CONFIG_SCHED_INFO is set Message-ID: <20150630061649.GC15883@naverao1-tp.in.ibm.com> References: <0ccc1c22699b73679cf13527c5d80b807a988859.1435255405.git.naveen.n.rao@linux.vnet.ibm.com> <20150630055537.GA21513@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150630055537.GA21513@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15063006-0033-0000-0000-00000683EA57 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/06/30 11:25AM, Srikar Dronamraju wrote: > * Naveen N. Rao [2015-06-25 23:53:38]: > > > /* > > * Provides /proc/PID/schedstat > > */ > > static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, > > struct pid *pid, struct task_struct *task) > > { > > - seq_printf(m, "%llu %llu %lu\n", > > + if (unlikely(!sched_info_on())) > > + seq_printf(m, "0 0 0\n"); > > + else > > + seq_printf(m, "%llu %lld %ld\n", > > Should the above be seq_printf(m, "%llu %llu %lu\n", ? Yikes! Nice catch, thanks! This looks to be left over from my tests with returning -1. Fixed patch on the way... Regards, Naveen