projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3178 from ashie/fix-match-regex-for-empty-meta
[collectd.git]
/
src
/
intel_pmu.c
diff --git
a/src/intel_pmu.c
b/src/intel_pmu.c
index
fc7d680
..
f04f887
100644
(file)
--- a/
src/intel_pmu.c
+++ b/
src/intel_pmu.c
@@
-27,9
+27,9
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
-#include "common.h"
+#include "
utils/common/
common.h"
-#include "utils
_
config_cores.h"
+#include "utils
/config_cores/
config_cores.h"
#include <jevents.h>
#include <jsession.h>
#include <jevents.h>
#include <jsession.h>
@@
-67,9
+67,9
@@
struct event_info {
typedef struct event_info event_info_t;
struct intel_pmu_ctx_s {
typedef struct event_info event_info_t;
struct intel_pmu_ctx_s {
-
_B
ool hw_cache_events;
-
_B
ool kernel_pmu_events;
-
_B
ool sw_events;
+
b
ool hw_cache_events;
+
b
ool kernel_pmu_events;
+
b
ool sw_events;
char event_list_fn[PATH_MAX];
char **hw_events;
size_t hw_events_count;
char event_list_fn[PATH_MAX];
char **hw_events;
size_t hw_events_count;
@@
-196,7
+196,8
@@
static void pmu_dump_config(void) {
DEBUG(PMU_PLUGIN ": software_events : %d", g_ctx.sw_events);
for (size_t i = 0; i < g_ctx.hw_events_count; i++) {
DEBUG(PMU_PLUGIN ": software_events : %d", g_ctx.sw_events);
for (size_t i = 0; i < g_ctx.hw_events_count; i++) {
- DEBUG(PMU_PLUGIN ": hardware_events[%zu]: %s", i, g_ctx.hw_events[i]);
+ DEBUG(PMU_PLUGIN ": hardware_events[%" PRIsz "]: %s", i,
+ g_ctx.hw_events[i]);
}
}
}
}
@@
-266,7
+267,7
@@
static int pmu_config_hw_events(oconfig_item_t *ci) {
return -EINVAL;
}
return -EINVAL;
}
- g_ctx.hw_events = calloc(ci->values_num, sizeof(
char *
));
+ g_ctx.hw_events = calloc(ci->values_num, sizeof(
*g_ctx.hw_events
));
if (g_ctx.hw_events == NULL) {
ERROR(PMU_PLUGIN ": Failed to allocate hw events.");
return -ENOMEM;
if (g_ctx.hw_events == NULL) {
ERROR(PMU_PLUGIN ": Failed to allocate hw events.");
return -ENOMEM;
@@
-445,7
+446,7
@@
static int pmu_add_events(struct eventlist *el, uint32_t type,
/* Allocate memory for event struct that contains array of efd structs
for all cores */
struct event *e =
/* Allocate memory for event struct that contains array of efd structs
for all cores */
struct event *e =
- calloc(
sizeof(struct event) + sizeof(struct efd) * el->num_cpus, 1
);
+ calloc(
1, sizeof(struct event) + sizeof(struct efd) * el->num_cpus
);
if (e == NULL) {
ERROR(PMU_PLUGIN ": Failed to allocate event structure");
return -ENOMEM;
if (e == NULL) {
ERROR(PMU_PLUGIN ": Failed to allocate event structure");
return -ENOMEM;
@@
-481,7
+482,7
@@
static int pmu_add_hw_events(struct eventlist *el, char **e, size_t count) {
/* Allocate memory for event struct that contains array of efd structs
for all cores */
struct event *e =
/* Allocate memory for event struct that contains array of efd structs
for all cores */
struct event *e =
- calloc(
sizeof(struct event) + sizeof(struct efd) * el->num_cpus, 1
);
+ calloc(
1, sizeof(struct event) + sizeof(struct efd) * el->num_cpus
);
if (e == NULL) {
free(events);
return -ENOMEM;
if (e == NULL) {
free(events);
return -ENOMEM;