Page MenuHomeFreeBSD

D40752.id123728.diff
No OneTemporary

D40752.id123728.diff

diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -1093,11 +1093,6 @@
assert(pmc_config.pm_ev < PMC_EVENT_FIRST);
goto found;
}
-
- /* Otherwise, reset any changes */
- pmc_config.pm_ev = 0;
- pmc_config.pm_caps = 0;
- pmc_config.pm_class = 0;
}
free(spec_copy);
spec_copy = NULL;
diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -574,8 +574,8 @@
return (0);
}
-int
-pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
+static int
+pmc_pmu_pmcallocate_md(const char *event_name, struct pmc_op_pmcallocate *pm)
{
const struct pmu_event *pe;
struct pmu_event_desc ped;
@@ -606,8 +606,8 @@
#elif defined(__powerpc64__)
-int
-pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
+static int
+pmc_pmu_pmcallocate_md(const char *event_name, struct pmc_op_pmcallocate *pm)
{
const struct pmu_event *pe;
struct pmu_event_desc ped;
@@ -633,8 +633,8 @@
#elif defined(__aarch64__)
-int
-pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
+static int
+pmc_pmu_pmcallocate_md(const char *event_name, struct pmc_op_pmcallocate *pm)
{
const struct pmu_event *pe;
struct pmu_event_desc ped;
@@ -660,9 +660,27 @@
#else
-int
-pmc_pmu_pmcallocate(const char *e __unused, struct pmc_op_pmcallocate *p __unused)
+static int
+pmc_pmu_pmcallocate_md(const char *e __unused, struct pmc_op_pmcallocate *p __unused)
{
return (EOPNOTSUPP);
}
#endif
+
+int
+pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
+{
+ int error;
+
+ error = pmc_pmu_pmcallocate_md(event_name, pm);
+ if (error != 0) {
+ /* Reset any changes. */
+ pm->pm_ev = 0;
+ pm->pm_caps = 0;
+ pm->pm_class = 0;
+
+ return (error);
+ }
+
+ return (0);
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 8, 10:02 AM (8 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29402518
Default Alt Text
D40752.id123728.diff (1 KB)

Event Timeline