The sdt_instr_t type was introduced as a generic type name for machine
instructions to be defined as a synonym for the arch-specific type.
It was named thusly because it was only used by the SDT support code.
However, other providers will need it also (e.g. FBT) and therefore it
is more appropriate to give it a name that is not tied to a specific
provider.
Orabug:
21220305
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Allen Pais <allen.pais@oracle.com>
--- /dev/null
+/* Copyright (C) 2013,2014 Oracle, Inc. */
+
+#ifndef _SPARC_DTRACE_ARCH_H
+#define _SPARC_DTRACE_ARCH_H
+
+typedef uint32_t asm_instr_t;
+
+#define SDT_TRAMP_SIZE 11
+
+#endif /* _SPARC_DTRACE_ARCH_H */
+++ /dev/null
-/* Copyright (C) 2013,2014 Oracle, Inc. */
-
-#ifndef _SPARC_DTRACE_SDT_H
-#define _SPARC_DTRACE_SDT_H
-
-typedef uint32_t sdt_instr_t;
-
-#define SDT_TRAMP_SIZE 11
-
-#endif /* _SPARC_DTRACE_SDT_H */
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <asm/cacheflush.h>
-#include <asm/dtrace_sdt.h>
+#include <asm/dtrace_arch.h>
-void __init_or_module dtrace_sdt_nop_multi(sdt_instr_t **addrs, int cnt)
+void __init_or_module dtrace_sdt_nop_multi(asm_instr_t **addrs, int cnt)
{
int i;
- sdt_instr_t *addr;
+ asm_instr_t *addr;
for (i = 0; i < cnt; i++) {
addr = addrs[i];
--- /dev/null
+/* Copyright (C) 2013-2014 Oracle, Inc. */
+
+#ifndef _X86_DTRACE_ARCH_H
+#define _X86_DTRACE_ARCH_H
+
+typedef uint8_t asm_instr_t;
+
+#endif /* _X86_DTRACE_ARCH_H */
+++ /dev/null
-/* Copyright (C) 2013-2014 Oracle, Inc. */
-
-#ifndef _X86_DTRACE_SDT_H
-#define _X86_DTRACE_SDT_H
-
-typedef uint8_t sdt_instr_t;
-
-#endif /* _X86_DTRACE_SDT_H */
#include <linux/vmalloc.h>
#include <asm/nmi.h>
#include <asm/nops.h>
-#include <asm/dtrace_sdt.h>
+#include <asm/dtrace_arch.h>
#define SDT_NOP_SIZE 5
* run before SMP is initialized in order to avoid SMP problems with patching
* code that might be accessed on another CPU.
*/
-void __init_or_module dtrace_sdt_nop_multi(sdt_instr_t **addrs, int cnt)
+void __init_or_module dtrace_sdt_nop_multi(asm_instr_t **addrs, int cnt)
{
int i;
- sdt_instr_t *addr;
+ asm_instr_t *addr;
unsigned long flags;
stop_nmi();
#ifndef _DTRACE_SDT_H_
#define _DTRACE_SDT_H_
-#include <asm/dtrace_sdt.h>
+#include <asm/dtrace_arch.h>
/*
* SDT probe called relocation information for the core kernel, provided by
/*
* Functions to be defined in arch/<arch>/kernel/dtrace_sdt.c
*/
-extern void __init_or_module dtrace_sdt_nop_multi(sdt_instr_t **, int);
+extern void __init_or_module dtrace_sdt_nop_multi(asm_instr_t **, int);
extern void dtrace_sdt_init_arch(void);
#endif /* _DTRACE_SDT_H_ */
const char *sdt_prefix = "__dtrace_probe_";
static int sdt_probe_set(sdt_probedesc_t *sdp, char *name, char *func,
- uintptr_t addr, sdt_instr_t **paddr)
+ uintptr_t addr, asm_instr_t **paddr)
{
if ((sdp->sdpd_name = kstrdup(name, GFP_KERNEL)) == NULL) {
kfree(sdp);
sdp->sdpd_offset = addr;
- *paddr = (sdt_instr_t *)addr;
+ *paddr = (asm_instr_t *)addr;
return 0;
}
(dtrace_sdt_probeinfo_t *)&dtrace_sdt_probes;
void *nextpi;
sdt_probedesc_t *sdps;
- sdt_instr_t **addrs;
+ asm_instr_t **addrs;
if (mp == NULL) {
pr_warning("%s: no module provided - nothing registered\n",
* Create a list of addresses (SDT probe locations) that need to be
* patched with a NOP instruction (or instruction sequence).
*/
- addrs = (sdt_instr_t **)vmalloc(dtrace_sdt_nprobes *
- sizeof(sdt_instr_t *));
+ addrs = (asm_instr_t **)vmalloc(dtrace_sdt_nprobes *
+ sizeof(asm_instr_t *));
if (addrs == NULL) {
pr_warning("%s: cannot allocate SDT probe address list\n",
__func__);
struct module *mp = args;
int i, cnt;
sdt_probedesc_t *sdp;
- sdt_instr_t **addrs;
+ asm_instr_t **addrs;
/*
* We only need to capture modules in the COMING state, we need a valid
* Create a list of addresses (SDT probe locations) that need to be
* patched with a NOP instruction (or instruction sequence).
*/
- addrs = (sdt_instr_t **)vmalloc(mp->sdt_probec *
- sizeof(sdt_instr_t *));
+ addrs = (asm_instr_t **)vmalloc(mp->sdt_probec *
+ sizeof(asm_instr_t *));
if (addrs == NULL) {
pr_warning("%s: cannot allocate SDT probe address list (%s)\n",
__func__, mp->name);
continue;
}
- addrs[cnt++] = (sdt_instr_t *)sdp->sdpd_offset;
+ addrs[cnt++] = (asm_instr_t *)sdp->sdpd_offset;
}
dtrace_sdt_nop_multi(addrs, cnt);