netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <lxhacker68@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Lawrence Brakmo <brakmo@fb.com>, Josef Bacik <jbacik@fb.com>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [RFC PATCH net-next 1/5] tcp: Add TCP TRACE_EVENTs
Date: Wed, 17 Dec 2014 08:08:04 -0700	[thread overview]
Message-ID: <54919C54.1050009@gmail.com> (raw)
In-Reply-To: <1418608606-1569264-2-git-send-email-kafai@fb.com>

On 12/14/14 6:56 PM, Martin KaFai Lau wrote:
> +DECLARE_EVENT_CLASS(tcp,
> +	TP_PROTO(struct sock *sk),
> +	TP_ARGS(sk),
> +	TP_STRUCT__entry(
> +		__field(u8, ipv6)
> +		__array(u8, laddr, 16)
> +		__array(u8, raddr, 16)

You could store the addresses as
union {
     struct sockaddr_in      v4;
     struct sockaddr_in6     v6;
} sa;


and then use:

> +	TP_printk("local=%s:%d remote=%s:%d snd_cwnd=%u mss_cache=%u "
> +		  "ssthresh=%u srtt_us=%llu rto_ms=%u",

%pIS to print the addresses in a more readable format than what 
__print_hex will show.

I have a patch to perf (and by extension it applies to trace-cmd) to 
handle pI4, pI6 and pI6c. It readily extends to pIS.

David

  reply	other threads:[~2014-12-17 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15  1:56 [RFC PATCH net-next 0/5] tcp: TCP tracer Martin KaFai Lau
2014-12-15  1:56 ` [RFC PATCH net-next 1/5] tcp: Add TCP TRACE_EVENTs Martin KaFai Lau
2014-12-17 15:08   ` David Ahern [this message]
2014-12-15  1:56 ` [RFC PATCH net-next 2/5] tcp: A perf script for TCP tracepoints Martin KaFai Lau
2014-12-15  1:56 ` [RFC PATCH net-next 3/5] tcp: Add a few more tracepoints for tcp tracer Martin KaFai Lau
2014-12-17 15:33   ` Arnaldo Carvalho de Melo
2014-12-17 15:59     ` David Ahern
2014-12-17 17:02       ` Arnaldo Carvalho de Melo
2014-12-15  1:56 ` [RFC PATCH net-next 4/5] tcp: Introduce tcp_sk_trace and related structs Martin KaFai Lau
2014-12-15  1:56 ` [RFC PATCH net-next 5/5] tcp: Add TCP tracer Martin KaFai Lau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54919C54.1050009@gmail.com \
    --to=lxhacker68@gmail.com \
    --cc=Kernel-team@fb.com \
    --cc=brakmo@fb.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=jbacik@fb.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).