From: Andi K. <an...@fi...> - 2009-04-29 15:03:09
|
On Wed, Apr 29, 2009 at 09:58:38AM -0500, Maynard Johnson wrote: > Andi Kleen wrote: > > > > Output more errors in make check before exitting. I found this useful > > while debugging large event files. > > > > Signed-off-by: Andi Kleen <ak...@li...> > > > > --- > > libop/op_events.c | 12 +++++++----- > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > Index: oprofile/libop/op_events.c > > =================================================================== > > --- oprofile.orig/libop/op_events.c 2009-04-01 22:57:37.000000000 +0200 > > +++ oprofile/libop/op_events.c 2009-04-27 10:34:51.000000000 +0200 > > @@ -403,20 +403,21 @@ > > > > > > /* usefull for make check */ > > -static void check_unit_mask(struct op_unit_mask const * um, > > +static int check_unit_mask(struct op_unit_mask const * um, > I agree with the concept of the patch, but the caller of check_unit_mask does not check the return value, so you don't get an exit() on failure. Can you fix that? It already does: /* sanity check: all unit mask must be used */ list_for_each(pos, &um_list) { struct op_unit_mask * um = list_entry(pos, struct op_unit_mask, um_next); err |= check_unit_mask(um, cpu_name); } if (err) exit(err); > Also, for completeness, maybe we should consider doing something similar for event parsing -- i.e., delay the exit on failure until we've parsed all events. Just a thought. Perhaps we should defer all this until after we put out the next release, though. At least this patch is a straight forward improvement suitable for any release. -Andi -- ak...@li... -- Speaking for myself only. |