All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>,
	linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH] tools lib traceevent: Add support for IP address formats
Date: Thu, 18 Dec 2014 19:16:01 -0300	[thread overview]
Message-ID: <20141218221601.GG3150@kernel.org> (raw)
In-Reply-To: <20141218112715.42420caf@gandalf.local.home>

Em Thu, Dec 18, 2014 at 11:27:15AM -0500, Steven Rostedt escreveu:
> On Thu, 18 Dec 2014 12:52:55 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> > Em Thu, Dec 18, 2014 at 08:10:43AM -0700, David Ahern escreveu:
> > > Adds helper for following kernel formats:
> > >   %pi4 print an IPv4 address with leading zeros
> > >   %pI4 print an IPv4 address without leading zeros
> > >   %pi6 print an IPv6 address without colons
> > >   %pI6 print an IPv6 address with colons
> > >   %pI6c print an IPv6 address with colons
> > >   %pISpc print an IP address from a sockaddr

> > > Allows these formats to be used in tracepoints.

> > > Quite a bit of this is adapted from code in lib/vsprintf.c.

> > Can't we try as much as possible use that code directly? Something like
 
> Until we have a true shared library, please no. I'm still taking code
> from here and adding it manually to trace-cmd. And also sending patches
> to here from what I add to trace-cmd.
 
> I do not want this directly linked to the kernel code. Note, the kernel
> internals have no guaranteed API, where this does.

If using it directly is frowned upon, at least try to reduce the
differences when copying code, be it by keeping function ordering in the
source code, using the same file name and generally making it easier to
see if changes ocurred on the original file over time.

> > we do for lib/rbtree.c in tools/perf/, or like I did recently with
> > tools/lib/util/find_next_bit.c, i.e. retain at least this kind of
> > sharing:

> > diff -u tools/lib/util/find_next_bit.c  lib/find_next_bit.c
 
> Unless we convert code to trace_seq, I don't think this works. My
> patches to move seq_buf.c int lib/ have made it into the kernel.
> Perhaps we can copy the seq_buf.c code into tools/lib/traceevent, but
> that would take some work.

Well, I thought that what that code was doing was just taking a string,
looking for some specific %LETTER stuff, acting on it and returning the
formatted result, i.e. a vsprintf function, thus I ended up shortcutting
too fast to the conclusion that it was possible, my bad :-)

If take the time to look at the specifics I'll propose something more
concrete, meanwhile, are you ok with David's changes? May I process his
patch?

- Arnaldo

  reply	other threads:[~2014-12-18 22:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 15:10 [PATCH] tools lib traceevent: Add support for IP address formats David Ahern
2014-12-18 15:52 ` Arnaldo Carvalho de Melo
2014-12-18 15:59   ` David Ahern
2014-12-18 16:27   ` Steven Rostedt
2014-12-18 22:16     ` Arnaldo Carvalho de Melo [this message]
2014-12-18 22:50       ` David Ahern
2014-12-18 21:45 ` Valdis.Kletnieks
2014-12-18 22:13   ` David Ahern
2014-12-19  1:41     ` David Ahern
2014-12-22 17:01       ` Jiri Olsa
2014-12-22 17:10         ` David Ahern
2014-12-22 17:28           ` Jiri Olsa
  -- strict thread matches above, loose matches on Subject: below --
2014-12-17 20:29 David Ahern
2014-12-18  4:26 ` Namhyung Kim
2014-12-18  4:32   ` David Ahern
2014-12-18  5:04     ` Namhyung Kim

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=20141218221601.GG3150@kernel.org \
    --to=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.