aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index b44132ead95a..59b0115de30a 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -429,12 +429,20 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
429 if (die_get_real_type(&type, &type) == NULL) 429 if (die_get_real_type(&type, &type) == NULL)
430 die("Failed to get a type information of %s.", varname); 430 die("Failed to get a type information of %s.", varname);
431 431
432 /* Verify it is a data structure */
433 if (dwarf_tag(&type) != DW_TAG_structure_type)
434 die("%s is not a data structure.", varname);
435
432 ref = xzalloc(sizeof(struct kprobe_trace_arg_ref)); 436 ref = xzalloc(sizeof(struct kprobe_trace_arg_ref));
433 if (*ref_ptr) 437 if (*ref_ptr)
434 (*ref_ptr)->next = ref; 438 (*ref_ptr)->next = ref;
435 else 439 else
436 *ref_ptr = ref; 440 *ref_ptr = ref;
437 } else { 441 } else {
442 /* Verify it is a data structure */
443 if (dwarf_tag(&type) != DW_TAG_structure_type)
444 die("%s is not a data structure.", varname);
445
438 if (field->ref) 446 if (field->ref)
439 die("Semantic error: %s must be referred by '.'", 447 die("Semantic error: %s must be referred by '.'",
440 field->name); 448 field->name);
@@ -442,10 +450,6 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
442 die("Structure on a register is not supported yet."); 450 die("Structure on a register is not supported yet.");
443 } 451 }
444 452
445 /* Verify it is a data structure */
446 if (dwarf_tag(&type) != DW_TAG_structure_type)
447 die("%s is not a data structure.", varname);
448
449 if (die_find_member(&type, field->name, &member) == NULL) 453 if (die_find_member(&type, field->name, &member) == NULL)
450 die("%s(tyep:%s) has no member %s.", varname, 454 die("%s(tyep:%s) has no member %s.", varname,
451 dwarf_diename(&type), field->name); 455 dwarf_diename(&type), field->name);