From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-187.mta1.migadu.com (out-187.mta1.migadu.com [95.215.58.187]) (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 99B62215771 for ; Wed, 22 Jan 2025 19:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737572551; cv=none; b=sAEHMYSnwOn7+NoHTI8T8iSJ3bVvQ6b30J4FuChHr/5FrYJX1tAOD3QCe/x9pg7BkseFN8RvNwoacIQQn4HUYASs9pNvKsgRQ2TkiwhPwPfDn7+NqM35OVALY0wtcK11uKabHmUK/2YN/h7HcBZraUvbXMy/6o9/4oHDsuRwegk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737572551; c=relaxed/simple; bh=yVOl7uKZwAPzL3hOo1/yIB0AA01qrS2OlwWoDfRibec=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KIPZhlwQbHx0whQpLCM2ju7NYxZv53/ABmh0yQ0NdLs9LSck+wg6quhqEQHAfri5AwpNlIpYt3eEWIEvJi02QpI2COU6sk50ZA2Oi80SC6xwU6pD5OatG2MSX3dnNAKqVYpL48GK0VFq9yDaJMUDDxPGOv5YJKBo9tj4lTAbL5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=dSTu3bEM; arc=none smtp.client-ip=95.215.58.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="dSTu3bEM" Message-ID: <453fbdbc-1843-498b-9a1c-8c83e7e244ed@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1737572536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g8FKpvfe4T9AnrcyGP1Vg1JqYGIC8GWW31gvSYVAm1E=; b=dSTu3bEMKZOMYG8VODFIRLWE+0EC6zY7TARf8/Jb94x02xb52o1JTn8e/cptSgx1KqH0Ga IU/fRr9lryQk1ho9fZT7Wmrub7Ipu4/2LeE04UEAWKoScthZHY+vnijyrz0uJtEo45EzjQ kd/KLlSxQ92RxISwLyMTUwv8tVxKUr4= Date: Wed, 22 Jan 2025 11:02:08 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH RFC net-next] trace: tcp: Add tracepoint for tcp_cwnd_reduction() Content-Language: en-GB To: Steven Rostedt , 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, Song Liu , Martin KaFai Lau 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> <20250122095604.3c93bc93@gandalf.local.home> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yonghong Song In-Reply-To: <20250122095604.3c93bc93@gandalf.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 1/22/25 6:56 AM, Steven Rostedt wrote: > 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. The LTTng approach in the above needs a kernel module to enable and disable the tracepoint and this is not a bpf-way to handle tracepoints. So for bpf, we need a new UAPI to pass from user space to the kernel to attach to tracepoint tp since is not available in trace_fs. What is the criteria for a tracepoint to be a normal tp or a bare tp? > > -- Steve >