Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / perf / arch / s390 / annotate / instructions.c
blob8c72b44444cb41200db9ecce0115aef47edde372
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/compiler.h>
4 static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name)
6 struct ins_ops *ops = NULL;
8 /* catch all kind of jumps */
9 if (strchr(name, 'j') ||
10 !strncmp(name, "bct", 3) ||
11 !strncmp(name, "br", 2))
12 ops = &jump_ops;
13 /* override call/returns */
14 if (!strcmp(name, "bras") ||
15 !strcmp(name, "brasl") ||
16 !strcmp(name, "basr"))
17 ops = &call_ops;
18 if (!strcmp(name, "br"))
19 ops = &ret_ops;
21 if (ops)
22 arch__associate_ins_ops(arch, name, ops);
23 return ops;
26 static int s390__annotate_init(struct arch *arch, char *cpuid __maybe_unused)
28 if (!arch->initialized) {
29 arch->initialized = true;
30 arch->associate_instruction_ops = s390__associate_ins_ops;
33 return 0;