From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11D0C19C56C; Wed, 22 Jan 2025 14:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737557762; cv=none; b=UGIUCsUPWsjNTs5rgeoEp8uxt1aTuQQCXaiWDf5K78zwIb8DEbLrLPxrqgVAVfbTFhbEzvutaYGgjCepRadPQPFtUpmcFFjFf7F4ZAZCAHiIrt6VpPrCj2Rcw7lqZ36j8belCZrsINC+KWJQgXjd0V30eWXqFkQeegsL8dRWNg8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737557762; c=relaxed/simple; bh=rvWlu+bKgz3ZewfcGUdmZW0sol8tRslku+B5BC3UbJ0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MfcHR+n6MrudPQEtrmIEWzaOAcBu7ha1zHmFx1BFZTpVvhyaU1eyI0wdkXj293DRadRe0sJoAN1mDTnTFCXusp3unVnwEuRBngYImqhruiMexPKo8tZE5wrVUnT0zzvM7Jd1XGqjJilCB9d2u9yqfKD+Ij82gQ724optyYJg+Aw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B7DEC4CED3; Wed, 22 Jan 2025 14:55:59 +0000 (UTC) Date: Wed, 22 Jan 2025 09:56:04 -0500 From: Steven Rostedt To: Breno Leitao Cc: Jason Xing , Eric Dumazet , Masami Hiramatsu , Mathieu Desnoyers , "David S. Miller" , David Ahern , Jakub Kicinski , Paolo Abeni , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kernel-team@meta.com, Yonghong Song , Song Liu , Martin KaFai Lau Subject: Re: [PATCH RFC net-next] trace: tcp: Add tracepoint for tcp_cwnd_reduction() Message-ID: <20250122095604.3c93bc93@gandalf.local.home> In-Reply-To: <20250122-vengeful-myna-of-tranquility-f0f8cf@leitao> References: <20250120-cwnd_tracepoint-v1-1-36b0e0d643fa@debian.org> <20250120-panda-of-impressive-aptitude-2b714e@leitao> <20250120-daring-outstanding-jaguarundi-c8aaed@leitao> <20250120100340.4129eff7@batman.local.home> <20250122-vengeful-myna-of-tranquility-f0f8cf@leitao> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 22 Jan 2025 01:39:42 -0800 Breno Leitao wrote: > Right, DECLARE_TRACE would solve my current problem, but, a056a5bed7fa > ("sched/debug: Export the newly added tracepoints") says "BPF doesn't > have infrastructure to access these bare tracepoints either.". > > Does BPF know how to attach to this bare tracepointers now? > > On the other side, it seems real tracepoints is getting more pervasive? > So, this current approach might be OK also? > > https://lore.kernel.org/bpf/20250118033723.GV1977892@ZenIV/T/#m4c2fb2d904e839b34800daf8578dff0b9abd69a0 Thanks for the pointer. I didn't know this discussion was going on. I just asked to attend if this gets accepted. I'm only a 6 hour drive from Montreal anyway. > > > You can see its use in include/trace/events/sched.h > > I suppose I need to export the tracepointer with > EXPORT_TRACEPOINT_SYMBOL_GPL(), right? For modules to use them directly, yes. But there's other ways too. > > I am trying to hack something as the following, but, I struggled to hook > BPF into it. Maybe you can use the iterator to search for the tracepoint. #include static void fct(struct tracepoint *tp, void *priv) { if (!tp->name || strcmp(tp->name, "") != 0) return 0; // attach to tracepoint tp } [..] for_each_kernel_tracepoint(fct, NULL); This is how LTTng hooks to tracepoints. -- Steve