Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932415AbdLOJxX (ORCPT ); Fri, 15 Dec 2017 04:53:23 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:57075 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932380AbdLOJxO (ORCPT ); Fri, 15 Dec 2017 04:53:14 -0500 Date: Fri, 15 Dec 2017 10:53:05 +0100 From: Peter Zijlstra To: Teng Qin Cc: Alexei Starovoitov , "mingo@redhat.com" , "bgregg@netflix.com" , "daniel@iogearbox.net" , Yonghong Song , "linux-kernel@vger.kernel.org" , Kernel Team Subject: Re: [PATCH tip 0/3] Improvements of scheduler related Tracepoints Message-ID: <20171215095305.o7yinfsoym6bgaem@hirez.programming.kicks-ass.net> References: <20171214202044.1629279-1-qinteng@fb.com> <20171214204932.GH3326@worktop> <1632e487-ee65-b50d-85e5-82f42c69fea1@fb.com> <20171215073908.myx3wgka7qimcmsg@hirez.programming.kicks-ass.net> <935FB65D-395D-4122-8E40-75CA04FF2111@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <935FB65D-395D-4122-8E40-75CA04FF2111@fb.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 701 Lines: 12 On Fri, Dec 15, 2017 at 08:53:30AM +0000, Teng Qin wrote: > To have access to related task_struct is one of the main purposes of these > patches. Take sched_switch as an example. We depend on the implementation > of the Tracepoint is called from prev or next (which could, although unlikedly, > change) and use current to get that task_struct, which feels, correct > me if I'm wrong, kind of defeating the purpose of Tracepoints being more > implementation-independent than kprobes. Then we have to figure out another > Tracepoint or most likely a kprobe function to get the other (prev or next) > task_struct. Go read how tracepoints work. The tracepoint_probe things get you exactly what you want.