Page MenuHomeFreeBSD

D40334.diff
No OneTemporary

D40334.diff

diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -78,8 +78,7 @@
struct pmc_op_pmcallocate *_pmc_config);
#endif /* __powerpc__ */
-#define PMC_CALL(cmd, params) \
- syscall(pmc_syscall, PMC_OP_##cmd, (params))
+#define PMC_CALL(op, params) syscall(pmc_syscall, (op), (params))
/*
* Event aliases provide a way for the user to ask for generic events
@@ -1152,7 +1151,7 @@
}
found:
- if (PMC_CALL(PMCALLOCATE, &pmc_config) == 0) {
+ if (PMC_CALL(PMC_OP_PMCALLOCATE, &pmc_config) == 0) {
*pmcid = pmc_config.pm_pmcid;
retval = 0;
}
@@ -1171,7 +1170,7 @@
pmc_attach_args.pm_pmc = pmc;
pmc_attach_args.pm_pid = pid;
- return (PMC_CALL(PMCATTACH, &pmc_attach_args));
+ return (PMC_CALL(PMC_OP_PMCATTACH, &pmc_attach_args));
}
int
@@ -1197,7 +1196,7 @@
cla.pm_flags = 0;
cla.pm_logfd = fd;
- if (PMC_CALL(CONFIGURELOG, &cla) < 0)
+ if (PMC_CALL(PMC_OP_CONFIGURELOG, &cla) < 0)
return (-1);
return (0);
}
@@ -1221,7 +1220,7 @@
pmc_detach_args.pm_pmc = pmc;
pmc_detach_args.pm_pid = pid;
- return (PMC_CALL(PMCDETACH, &pmc_detach_args));
+ return (PMC_CALL(PMC_OP_PMCDETACH, &pmc_detach_args));
}
int
@@ -1232,7 +1231,7 @@
ssa.pm_cpu = cpu;
ssa.pm_pmc = pmc;
ssa.pm_state = PMC_STATE_DISABLED;
- return (PMC_CALL(PMCADMIN, &ssa));
+ return (PMC_CALL(PMC_OP_PMCADMIN, &ssa));
}
int
@@ -1243,7 +1242,7 @@
ssa.pm_cpu = cpu;
ssa.pm_pmc = pmc;
ssa.pm_state = PMC_STATE_FREE;
- return (PMC_CALL(PMCADMIN, &ssa));
+ return (PMC_CALL(PMC_OP_PMCADMIN, &ssa));
}
/*
@@ -1355,13 +1354,13 @@
int
pmc_flush_logfile(void)
{
- return (PMC_CALL(FLUSHLOG,0));
+ return (PMC_CALL(PMC_OP_FLUSHLOG, 0));
}
int
pmc_close_logfile(void)
{
- return (PMC_CALL(CLOSELOG,0));
+ return (PMC_CALL(PMC_OP_CLOSELOG, 0));
}
int
@@ -1369,7 +1368,7 @@
{
struct pmc_op_getdriverstats gms;
- if (PMC_CALL(GETDRIVERSTATS, &gms) < 0)
+ if (PMC_CALL(PMC_OP_GETDRIVERSTATS, &gms) < 0)
return (-1);
/* copy out fields in the current userland<->library interface */
@@ -1390,7 +1389,7 @@
struct pmc_op_getmsr gm;
gm.pm_pmcid = pmc;
- if (PMC_CALL(PMCGETMSR, &gm) < 0)
+ if (PMC_CALL(PMC_OP_PMCGETMSR, &gm) < 0)
return (-1);
*msr = gm.pm_msr;
return (0);
@@ -1420,7 +1419,7 @@
/* check the kernel module's ABI against our compiled-in version */
abi_version = PMC_VERSION;
- if (PMC_CALL(GETMODULEVERSION, &abi_version) < 0)
+ if (PMC_CALL(PMC_OP_GETMODULEVERSION, &abi_version) < 0)
return (pmc_syscall = -1);
/* ignore patch & minor numbers for the comparison */
@@ -1430,7 +1429,7 @@
}
bzero(&op_cpu_info, sizeof(op_cpu_info));
- if (PMC_CALL(GETCPUINFO, &op_cpu_info) < 0)
+ if (PMC_CALL(PMC_OP_GETCPUINFO, &op_cpu_info) < 0)
return (pmc_syscall = -1);
cpu_info.pm_cputype = op_cpu_info.pm_cputype;
@@ -1451,7 +1450,7 @@
* Get soft events list.
*/
soft_event_info.pm_class = PMC_CLASS_SOFT;
- if (PMC_CALL(GETDYNEVENTINFO, &soft_event_info) < 0)
+ if (PMC_CALL(PMC_OP_GETDYNEVENTINFO, &soft_event_info) < 0)
return (pmc_syscall = -1);
/* Map soft events to static list. */
@@ -1833,7 +1832,7 @@
pmci->pm_cpu = cpu;
- if (PMC_CALL(GETPMCINFO, pmci) < 0) {
+ if (PMC_CALL(PMC_OP_GETPMCINFO, pmci) < 0) {
free(pmci);
return (-1);
}
@@ -1852,7 +1851,7 @@
pmc_read_op.pm_flags = PMC_F_OLDVALUE;
pmc_read_op.pm_value = -1;
- if (PMC_CALL(PMCRW, &pmc_read_op) < 0)
+ if (PMC_CALL(PMC_OP_PMCRW, &pmc_read_op) < 0)
return (-1);
*value = pmc_read_op.pm_value;
@@ -1865,7 +1864,7 @@
struct pmc_op_simple pmc_release_args;
pmc_release_args.pm_pmcid = pmc;
- return (PMC_CALL(PMCRELEASE, &pmc_release_args));
+ return (PMC_CALL(PMC_OP_PMCRELEASE, &pmc_release_args));
}
int
@@ -1877,7 +1876,7 @@
pmc_rw_op.pm_flags = PMC_F_NEWVALUE | PMC_F_OLDVALUE;
pmc_rw_op.pm_value = newvalue;
- if (PMC_CALL(PMCRW, &pmc_rw_op) < 0)
+ if (PMC_CALL(PMC_OP_PMCRW, &pmc_rw_op) < 0)
return (-1);
*oldvaluep = pmc_rw_op.pm_value;
@@ -1892,7 +1891,7 @@
sc.pm_pmcid = pmc;
sc.pm_count = value;
- if (PMC_CALL(PMCSETCOUNT, &sc) < 0)
+ if (PMC_CALL(PMC_OP_PMCSETCOUNT, &sc) < 0)
return (-1);
return (0);
}
@@ -1903,7 +1902,7 @@
struct pmc_op_simple pmc_start_args;
pmc_start_args.pm_pmcid = pmc;
- return (PMC_CALL(PMCSTART, &pmc_start_args));
+ return (PMC_CALL(PMC_OP_PMCSTART, &pmc_start_args));
}
int
@@ -1912,7 +1911,7 @@
struct pmc_op_simple pmc_stop_args;
pmc_stop_args.pm_pmcid = pmc;
- return (PMC_CALL(PMCSTOP, &pmc_stop_args));
+ return (PMC_CALL(PMC_OP_PMCSTOP, &pmc_stop_args));
}
int
@@ -1939,7 +1938,7 @@
pmc_write_op.pm_pmcid = pmc;
pmc_write_op.pm_flags = PMC_F_NEWVALUE;
pmc_write_op.pm_value = value;
- return (PMC_CALL(PMCRW, &pmc_write_op));
+ return (PMC_CALL(PMC_OP_PMCRW, &pmc_write_op));
}
int
@@ -1948,5 +1947,5 @@
struct pmc_op_writelog wl;
wl.pm_userdata = userdata;
- return (PMC_CALL(WRITELOG, &wl));
+ return (PMC_CALL(PMC_OP_WRITELOG, &wl));
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 3:00 AM (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14728619
Default Alt Text
D40334.diff (4 KB)

Event Timeline