linux/tools/lib
David Ahern 3d199b5be5 tools lib traceevent: Add support for IP address formats
Add helpers for the 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 in compressed form 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.

v4:
- fixed pI6c description in git commit message per Valdis' comment

v3:
- use of 'c' and 'p' requires 'I'

v2:
- pass ptr+1 to print_ip_arg per Namhyung's comments
- added field length checks to sockaddr function

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1418955071-36241-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-01-26 12:04:41 -03:00
..
api tools lib fs debugfs: Check if debugfs is mounted when handling ENOENT 2015-01-22 17:02:23 -03:00
lockdep tools/liblockdep: Fix debug_check thinko in mutex destroy 2014-12-19 15:50:55 -05:00
symbol tools lib symbol: Start carving out symbol parsing routines from perf 2013-12-13 10:30:20 -03:00
traceevent tools lib traceevent: Add support for IP address formats 2015-01-26 12:04:41 -03:00
util tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib 2014-12-17 11:14:48 -03:00