From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876AbcGFNO6 (ORCPT ); Wed, 6 Jul 2016 09:14:58 -0400 Received: from smtprelay0245.hostedemail.com ([216.40.44.245]:52530 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751757AbcGFNO4 convert rfc822-to-8bit (ORCPT ); Wed, 6 Jul 2016 09:14:56 -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:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1513:1515:1516:1518:1521:1535:1543:1593:1594:1605:1711:1730:1747:1777:1792:2393:2553:2559:2562:2897:2910:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6120:6261:7875:7903:8526:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12198:12296:12438:12517:12519:12555:12663:12740:13439:14096:14097:14181:14659:14721:21080,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:3,LUA_SUMMARY:none X-HE-Tag: place61_755cba1c10e4d X-Filterd-Recvd-Size: 5038 Date: Wed, 6 Jul 2016 09:13:25 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: Julien Desfossez , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , daolivei@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] tracing: add sched_prio_update Message-ID: <20160706091325.3f9879eb@gandalf.local.home> In-Reply-To: <355420018.58738.1467755434744.JavaMail.zimbra@efficios.com> References: <1467661564-7516-1-git-send-email-jdesfossez@efficios.com> <20160705111914.238b28ee@gandalf.local.home> <355420018.58738.1467755434744.JavaMail.zimbra@efficios.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jul 2016 21:50:34 +0000 (UTC) Mathieu Desnoyers wrote: > > > >> + > >> + TP_PROTO(struct task_struct *tsk), > >> + > >> + TP_ARGS(tsk), > >> + > >> + TP_STRUCT__entry( > >> + __array( char, comm, TASK_COMM_LEN ) > > > > I could imagine this being a high frequency tracepoint, especially with > > a lot of boosting going on. Can we nuke the comm recording and let the > > userspace tools just hook to the sched_switch tracepoint for that? > > We can surely do that. > > Just to clarify: currently this tracepoint is *not* hooked on PI boosting, > as described in the changelog. This tracepoint is about the prio attributes > set by user-space. The PI boosting temporarily changes the task struct prio > without updating the associated policy, which seems rather > implementation-specific and odd to expose. > > Thoughts ? Ah, you're right, I was thinking it was at boosting. But still, it's a rather hefty tracepoint (lots of fields), probably want to keep from adding comm too. > > Thanks, > > Mathieu > > > > > > -- Steve > > > > > >> + __field( pid_t, pid ) > >> + __field( unsigned int, policy ) > >> + __field( int, nice ) > >> + __field( unsigned int, rt_priority ) > >> + __field( u64, dl_runtime ) > >> + __field( u64, dl_deadline ) > >> + __field( u64, dl_period ) > >> + ), > >> + > >> + TP_fast_assign( > >> + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); > >> + __entry->pid = tsk->pid; > >> + __entry->policy = tsk->policy; > >> + __entry->nice = task_nice(tsk); > >> + __entry->rt_priority = tsk->rt_priority; > >> + __entry->dl_runtime = tsk->dl.dl_runtime; > >> + __entry->dl_deadline = tsk->dl.dl_deadline; > >> + __entry->dl_period = tsk->dl.dl_period; > >> + ), > >> + > >> + TP_printk("comm=%s pid=%d, policy=%s, nice=%d, rt_priority=%u, " > >> + "dl_runtime=%Lu, dl_deadline=%Lu, dl_period=%Lu", > >> + __entry->comm, __entry->pid, > >> + __print_symbolic(__entry->policy, SCHEDULING_POLICY), > >> + __entry->nice, __entry->rt_priority, > >> + __entry->dl_runtime, __entry->dl_deadline, > >> + __entry->dl_period) > >> +); > >> #endif /* _TRACE_SCHED_H */ > >> > >> /* This part must be outside protection */ > >> diff --git a/kernel/fork.c b/kernel/fork.c > >> index 7926993..ac4294a 100644 > >> --- a/kernel/fork.c > >> +++ b/kernel/fork.c > >> @@ -1773,6 +1773,7 @@ long _do_fork(unsigned long clone_flags, > >> struct pid *pid; > >> > >> trace_sched_process_fork(current, p); > >> + trace_sched_prio_update(p); >>From the change log: "It is emitted in the code path of the sched_setscheduler, sched_setattr, sched_setparam, nice and the fork system calls. For fork, it is emitted after the sched_process_fork tracepoint for timeline consistency and because the PID is not yet set when sched_fork() is called." I'm not convinced this should be needed. I hate adding back to back tracepoints. -- Steve > >> pid = get_task_pid(p, PIDTYPE_PID); > >> nr = pid_vnr(pid); > >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c > >> index ce83e39..c729425 100644 > >> --- a/kernel/sched/core.c > >> +++ b/kernel/sched/core.c > >> @@ -3708,6 +3708,7 @@ void set_user_nice(struct task_struct *p, long nice) > >> resched_curr(rq); > >> } > >> out_unlock: > >> + trace_sched_prio_update(p); > >> task_rq_unlock(rq, p, &rf); > >> } > >> EXPORT_SYMBOL(set_user_nice); > >> @@ -3912,6 +3913,8 @@ static void __setscheduler(struct rq *rq, struct > >> task_struct *p, > >> p->sched_class = &rt_sched_class; > >> else > >> p->sched_class = &fair_sched_class; > >> + > >> + trace_sched_prio_update(p); > >> } > >> > > > static void >