Skip to content

tools lib traceevent: Get rid of *die() calls from parse-filter.c (v2)

Namhyung Kim lkml 1 version Applied

Status from this message: I've applied all the previous patches, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/14tools lib traceevent: Get rid of malloc_or_die() in show_error()tools/lib/traceevent/parse-filter.c+15 -10 replies
2/14tools lib traceevent: Get rid of die in add_filter_type()tools/lib/traceevent/parse-filter.c+16 -50 replies
3/14tools lib traceevent: Get rid of malloc_or_die() allocate_arg()tools/lib/traceevent/parse-filter.c+40 -80 replies
4/14tools lib traceevent: Get rid of malloc_or_die() in read_token()tools/lib/traceevent/parse-filter.c+7 -10 replies
5/14tools lib traceevent: Get rid of malloc_or_die() in find_event()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+22 -90 replies
6/14tools lib traceevent: Get rid of die() in add_right()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+26 -160 replies
7/14tools lib traceevent: Make add_left() return pevent_errnotools/lib/traceevent/parse-filter.c+3 -30 replies
8/14tools lib traceevent: Get rid of die() in reparent_op_arg()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+64 -350 replies
9/14tools lib traceevent: Refactor create_arg_item()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+12 -110 replies
10/14tools lib traceevent: Refactor process_filter()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+42 -280 replies
11/14tools lib traceevent: Make pevent_filter_add_filter_str() return pevent_errnotools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+27 -590 replies
12/14tools lib traceevent: Refactor pevent_filter_match() to get rid of die()tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+99 -570 replies
13/14tools lib traceevent: Get rid of die() in some string conversion funcitonstools/lib/traceevent/parse-filter.c+36 -228 replies
14/14tools lib traceevent: Introduce pevent_filter_strerror()tools/lib/traceevent/event-parse.c tools/lib/traceevent/event-parse.h tools/lib/traceevent/parse-filter.c+61 -610 replies

Reviews trailers per patch

5 of 14 patches have a Reviewed-by or Acked-by.

PatchSteven Rostedt
1/14
2/14R-b
3/14
4/14R-b
5/14R-b
6/14R-b
7/14
8/14R-b
9/14
10/14
11/14
12/14
13/14
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCHSET 00/14] tools lib traceevent: Get rid of *die() calls from parse-filter.c (v2)

Hello,

This patchset tries to remove all die() calls in event filter parsing code. I changed two main functions of pevent_filter_add_filter_str() and pevent_filter_match() to return a proper error code (pevent_errno).

The actual error message might be saved in a static buffer in pevent_ filter and it can be accessed by new pevent_filter_strerror() function. The old pevent_strerror() still works for them too.

The only remaining bits are in trace-seq.c which implement print functions and I want to hear what's the best way we can handle the error case during the print.

I also put this patches on libtraceevent/die-removal-v2 branch in my tree

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Any comments are welcome, thanks
Namhyung

Namhyung Kim (14):
tools lib traceevent: Get rid of malloc_or_die() in show_error() tools lib traceevent: Get rid of die in add_filter_type() tools lib traceevent: Get rid of malloc_or_die() allocate_arg() tools lib traceevent: Get rid of malloc_or_die() in read_token() tools lib traceevent: Get rid of malloc_or_die() in find_event() tools lib traceevent: Get rid of die() in add_right() tools lib traceevent: Make add_left() return pevent_errno tools lib traceevent: Get rid of die() in reparent_op_arg() tools lib traceevent: Refactor create_arg_item()
tools lib traceevent: Refactor process_filter()
tools lib traceevent: Make pevent_filter_add_filter_str() return
pevent_errno
tools lib traceevent: Refactor pevent_filter_match() to get rid of

    die()

tools lib traceevent: Get rid of die() in some string conversion
funcitons
tools lib traceevent: Introduce pevent_filter_strerror()

 tools/lib/traceevent/event-parse.c  |  17 +-
 tools/lib/traceevent/event-parse.h  |  48 ++-
 tools/lib/traceevent/parse-filter.c | 615 ++++++++++++++++++++++--------------
 3 files changed, 417 insertions(+), 263 deletions(-)
Signature · 1 line
1.7.11.7