static struct ins_ops *powerpc__associate_instruction_ops(struct arch *arch, const char *name) { int i; struct ins_ops *ops; /* * - Interested only if instruction starts with 'b'. * - Few start with 'b', but aren't branch instructions. */ if (name[0] != 'b' || !strncmp(name, "bcd", 3) || !strncmp(name, "brinc", 5) || !strncmp(name, "bper", 4)) return NULL; ops = &jump_ops; i = strlen(name) - 1; if (i < 0) return NULL; /* ignore optional hints at the end of the instructions */ if (name[i] == '+' || name[i] == '-') i--; if (name[i] == 'l' || (name[i] == 'a' && name[i-1] == 'l')) { /* * if the instruction ends up with 'l' or 'la', then * those are considered 'calls' since they update LR. * ... except for 'bnl' which is branch if not less than * and the absolute form of the same. */ if (strcmp(name, "bnl") && strcmp(name, "bnl+") && strcmp(name, "bnl-") && strcmp(name, "bnla") && strcmp(name, "bnla+") && strcmp(name, "bnla-")) ops = &call_ops; } if (name[i] == 'r' && name[i-1] == 'l') /* * instructions ending with 'lr' are considered to be * return instructions */ ops = &ret_ops; arch__associate_ins_ops(arch, name, ops); return ops; } static int powerpc__annotate_init(struct arch *arch) { if (!arch->initialized) { arch->initialized = true; arch->associate_instruction_ops = powerpc__associate_instruction_ops; arch->objdump.comment_char = '#'; } return 0; } auser
summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-11 10:17:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-11 10:17:39 -0800
commit2e4333c14de06a333783d6812cf3c4998f78b0c8 (patch)
tree368428514d70f34f2261c7f954f241f886d6bb51 /tools/perf/builtin-stat.c
parent045169816b31b10faed984b01c390db1b32ee4c1 (diff)
parentba735155b9647b6167fd50276ca0fbfbce4e836c (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "Two more MIPS fixes for 4.9: - RTC: Return -ENODEV so an external RTC will be tried - Fix mask of GPE frequency These two have been tested on Imagination's automated test system and also both received positive reviews on the linux-mips mailing list" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Lantiq: Fix mask of GPE frequency MIPS: Return -ENODEV from weak implementation of rtc_mips_set_time
Diffstat (limited to 'tools/perf/builtin-stat.c')