[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250604103644.4b41b9a3@gandalf.local.home>
Date: Wed, 4 Jun 2025 10:36:44 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Prakash Sangappa <prakash.sangappa@...cle.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
mathieu.desnoyers@...icios.com, tglx@...utronix.de, bigeasy@...utronix.de,
kprateek.nayak@....com, vineethr@...ux.ibm.com
Subject: Re: [PATCH V5 5/6] Sched: Add tracepoint for sched time slice
extension
On Tue, 3 Jun 2025 23:36:53 +0000
Prakash Sangappa <prakash.sangappa@...cle.com> wrote:
> @@ -134,6 +138,10 @@ __always_inline unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
> ti_work = read_thread_flags();
> }
>
> + if (ti_work_cleared)
> + trace_sched_delay_resched(current, ti_work_cleared &
> + (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY));
> +
Please make the above into a conditional tracepoint and you can also just
pass in ti_work_cleared. No reason to do that outside the tracepoint. As
the above is always checked regardless if tracing is enabled or not.
TRACE_EVENT_CONDITION(sched_delay_resched,
TP_PROTO(struct task_struct *p, unsigned int ti_work_cleared),
TP_ARGS(p, ti_work_cleared),
TP_CONDITION(ti_work_cleared),
TP_STRUCT__entry(
__array( char, comm, TASK_COMM_LEN )
__field( pid_t, pid )
__field( int, cpu )
__field( int, flg )
),
TP_fast_assign(
memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
__entry->pid = p->pid;
__entry->cpu = task_cpu(p);
__entry->flg = ti_work_cleared & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY);
),
-- Steve
Powered by blists - more mailing lists