From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935466AbdACPCc (ORCPT ); Tue, 3 Jan 2017 10:02:32 -0500 Received: from smtprelay0104.hostedemail.com ([216.40.44.104]:35796 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935321AbdACPBD (ORCPT ); Tue, 3 Jan 2017 10:01:03 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:901:960:967:973:982:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6119:6261:7576:7875:7903:7904:8599:8960:9025:9388:10004:10400:10848:10967:11026:11232:11658:11914:12043:12555:12740:12760:12895:12903:12986:13069:13311:13357:13439:13870:14181:14659:14721:21080:21451:30034:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: waves29_6022d5f211613 X-Filterd-Recvd-Size: 3018 Date: Tue, 3 Jan 2017 10:00:59 -0500 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Alexander Shishkin , Jiri Olsa Subject: Re: [PATCH] tools lib traceevent: Fix prev/next_prio for deadline tasks Message-ID: <20170103100059.638e588d@gandalf.local.home> In-Reply-To: <866ef75bcebf670ae91c6a96daa63597ba981f0d.1483443552.git.bristot@redhat.com> References: <866ef75bcebf670ae91c6a96daa63597ba981f0d.1483443552.git.bristot@redhat.com> X-Mailer: Claws Mail 3.14.0 (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 Tue, 3 Jan 2017 12:42:42 +0100 Daniel Bristot de Oliveira wrote: > From: Daniel Bristot de Oliveiva > > Currently, the sched:sched_switch tracepoint reports deadline tasks > with priority -1. But when reading the trace via perf script I've > got the following output: > > # ./d & # (d is a deadline task, see [1]) > # perf record -e sched:sched_switch -a sleep 1 > # perf script > ... > swapper 0 [000] 2146.962441: sched:sched_switch: swapper/0:0 [120] R ==> d:2593 [4294967295] > d 2593 [000] 2146.972472: sched:sched_switch: d:2593 [4294967295] R ==> g:2590 [4294967295] > > The task d reports the wrong priority [4294967295]. This happens because > the "int prio" is stored in an unsigned long long val. Although it is > set as a %lld, as int is shorter than unsigned long long, > trace_seq_printf prints it as a positive number. > > The fix is just to cast the val as an int, and print it as a %d, > as in the sched:sched_switch tracepoint's "format". > > The output with the fix is: > > # ./d & > # perf record -e sched:sched_switch -a sleep 1 > # perf script > ... > swapper 0 [000] 4306.374037: sched:sched_switch: swapper/0:0 [120] R ==> d:10941 [-1] > d 10941 [000] 4306.383823: sched:sched_switch: d:10941 [-1] R ==> swapper/0:0 [120] > > [1] gcc -o d d.c - from http://bristot.me/lkml/d.c > > Signed-off-by: Daniel Bristot de Oliveira > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Arnaldo Carvalho de Melo > Cc: Alexander Shishkin > Cc: Jiri Olsa > Cc: linux-kernel@vger.kernel.org > Acked-by: Steven Rostedt --- :-) -- Steve