[CTRACER]: Check if the specified class exists
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
8b8166f0a8
commit
7465f3c2f0
11
ctracer.c
11
ctracer.c
|
@ -469,6 +469,8 @@ int main(int argc, char *argv[])
|
|||
const char *filename = NULL, *dirname = NULL, *glob = NULL,
|
||||
*kprobes_filename = NULL;
|
||||
char *class_name = NULL;
|
||||
struct tag *class;
|
||||
struct cu *cu;
|
||||
|
||||
while ((option = getopt_long(argc, argv, "D:g:k:rh",
|
||||
long_options, &option_index)) >= 0)
|
||||
|
@ -561,6 +563,15 @@ out_dwarf_err:
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if the specified struct exists:
|
||||
*/
|
||||
class = cus__find_struct_by_name(methods_cus, &cu, class_name);
|
||||
if (class == NULL) {
|
||||
fprintf(stderr, "ctracer: struct %s not found!\n", class_name);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
emit_module_preamble();
|
||||
cus__for_each_cu(methods_cus, cu_find_methods_iterator,
|
||||
class_name, NULL);
|
||||
|
|
Loading…
Reference in New Issue