perf annotate: Handle ins parsing failures
Don't use the ins's ->sncprintf() if the parsing failed.
For example, this fixes the display of "imul %edx". Without this patch:
| imul (null),(null)
After this patch:
| imul %edx
Signed-off-by: Rabin Vincent <rabin@rab.in>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1421607621-15005-1-git-send-email-rabin@rab.in
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
75e0b5f010
commit
be81908c22
@@ -183,8 +183,9 @@ static int lock__parse(struct ins_operands *ops)
|
|||||||
if (!ops->locked.ins->ops)
|
if (!ops->locked.ins->ops)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ops->locked.ins->ops->parse)
|
if (ops->locked.ins->ops->parse &&
|
||||||
ops->locked.ins->ops->parse(ops->locked.ops);
|
ops->locked.ins->ops->parse(ops->locked.ops) < 0)
|
||||||
|
goto out_free_ops;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -531,8 +532,8 @@ static void disasm_line__init_ins(struct disasm_line *dl)
|
|||||||
if (!dl->ins->ops)
|
if (!dl->ins->ops)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (dl->ins->ops->parse)
|
if (dl->ins->ops->parse && dl->ins->ops->parse(&dl->ops) < 0)
|
||||||
dl->ins->ops->parse(&dl->ops);
|
dl->ins = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int disasm_line__parse(char *line, char **namep, char **rawp)
|
static int disasm_line__parse(char *line, char **namep, char **rawp)
|
||||||
|
|||||||
Reference in New Issue
Block a user