[CODIFF]: in verbose mode show if a function was removed or added

[acme@newtoy pahole]$ codiff -V build/libclasses.so.orig build/libclasses.so
/home/acme/pahole/classes.c:
  cu__create_new_tag              | -136 (removed)
  cu__create_new_class            | -123 (removed)
  cu__create_new_union            | -123 (removed)
  cu__create_new_base_type        | -112 (removed)
  cu__create_new_typedef          | -112 (removed)
  cu__create_new_array            | -474 (removed)
  cu__create_new_parameter        | -102 (removed)
  cu__create_new_label            |  -76 (removed)
  cu__create_new_variable         |  -76 (removed)
  cu__create_new_subroutine_type  | -216 (removed)
  cu__create_new_enumeration      | -261 (removed)
  cu__process_class               | -264 (removed)
  cu__create_new_lexblock         | -109 (removed)
  cu__create_new_inline_expansion |  -76 (removed)
  cu__process_function            | -424 (removed)
  cu__create_new_function         |  -96 (removed)
  cu__process_unit                | -319 (removed)
  cu__process                     | -249 (removed)
 18 functions changed, 3348 bytes removed

/home/acme/pahole/classes.c:
  die__create_new_tag              | +136 (added)
  die__create_new_class            | +123 (added)
  die__create_new_union            | +123 (added)
  die__create_new_base_type        | +112 (added)
  die__create_new_typedef          | +112 (added)
  die__create_new_array            | +474 (added)
  die__create_new_parameter        | +102 (added)
  die__create_new_label            |  +76 (added)
  die__create_new_variable         |  +76 (added)
  die__create_new_subroutine_type  | +216 (added)
  die__create_new_enumeration      | +261 (added)
  die__process_class               | +264 (added)
  die__create_new_lexblock         | +109 (added)
  die__create_new_inline_expansion |  +76 (added)
  die__process_function            | +410 (added)
  die__create_new_function         |  +96 (added)
  die__process_unit                | +319 (added)
  die__process                     | +249 (added)
 18 functions changed, 3334 bytes added

build/libclasses.so:
 36 functions changed, 3334 bytes added, 3348 bytes removed

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-09 12:16:46 -02:00
parent 049c8fccfc
commit 49907df8a9
1 changed files with 6 additions and 5 deletions

View File

@ -349,7 +349,8 @@ static int cu_diff_iterator(struct cu *cu, void *new_cus)
return 0;
}
static void show_diffs_function(struct function *function, const struct cu *cu)
static void show_diffs_function(struct function *function, const struct cu *cu,
const void *cookie)
{
const struct diff_info *di = function->priv;
@ -363,7 +364,7 @@ static void show_diffs_function(struct function *function, const struct cu *cu)
}
if (di->tag == NULL)
puts("(null)");
puts(cookie ? " (added)" : " (removed)");
else {
const struct function *twin = tag__function(di->tag);
@ -489,12 +490,12 @@ static void show_diffs_structure(const struct class *structure,
}
static int show_function_diffs_iterator(struct tag *tag, struct cu *cu,
void *new_cu)
void *cookie)
{
struct function *function = tag__function(tag);
if (tag->tag == DW_TAG_subprogram && function->priv != NULL)
show_diffs_function(function, cu);
show_diffs_function(function, cu, cookie);
return 0;
}
@ -545,7 +546,7 @@ static int cu_show_diffs_iterator(struct cu *cu, void *cookie)
if (cu->nr_functions_changed != 0 && show_function_diffs) {
total_nr_functions_changed += cu->nr_functions_changed;
cu__for_each_tag(cu, show_function_diffs_iterator, NULL, NULL);
cu__for_each_tag(cu, show_function_diffs_iterator, cookie, NULL);
printf(" %u function%s changed", cu->nr_functions_changed,
cu->nr_functions_changed > 1 ? "s" : "");
if (cu->function_bytes_added != 0) {