summaryrefslogtreecommitdiffstats
path: root/collectors/perf.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-06 16:11:34 +0000
commitd079b656b4719739b2247dcd9d46e9bec793095a (patch)
treed2c950c70a776bcf697c963151c5bd959f8a9f03 /collectors/perf.plugin
parentReleasing debian version 1.37.1-2. (diff)
downloadnetdata-d079b656b4719739b2247dcd9d46e9bec793095a.tar.xz
netdata-d079b656b4719739b2247dcd9d46e9bec793095a.zip
Merging upstream version 1.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/perf.plugin')
-rw-r--r--collectors/perf.plugin/README.md8
-rw-r--r--collectors/perf.plugin/perf_plugin.c21
2 files changed, 17 insertions, 12 deletions
diff --git a/collectors/perf.plugin/README.md b/collectors/perf.plugin/README.md
index a7a87aca..9e114363 100644
--- a/collectors/perf.plugin/README.md
+++ b/collectors/perf.plugin/README.md
@@ -1,6 +1,10 @@
<!--
-title: "perf.plugin"
-custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/perf.plugin/README.md
+title: "Monitor CPU performance statistics (perf.plugin)"
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/perf.plugin/README.md"
+sidebar_label: "CPU performance statistics (perf.plugin)"
+learn_status: "Published"
+learn_topic_type: "References"
+learn_rel_path: "References/Collectors references/System metrics"
-->
# perf.plugin
diff --git a/collectors/perf.plugin/perf_plugin.c b/collectors/perf.plugin/perf_plugin.c
index b2f7d2e1..68c0f917 100644
--- a/collectors/perf.plugin/perf_plugin.c
+++ b/collectors/perf.plugin/perf_plugin.c
@@ -294,15 +294,15 @@ static int perf_init() {
if(unlikely(fd < 0)) {
switch errno {
case EACCES:
- error("Cannot access to the PMU: Permission denied");
+ collector_error("Cannot access to the PMU: Permission denied");
break;
case EBUSY:
- error("Another event already has exclusive access to the PMU");
+ collector_error("Another event already has exclusive access to the PMU");
break;
default:
- error("Cannot open perf event");
+ collector_error("Cannot open perf event");
}
- error("Disabling event %u", current_event->id);
+ collector_error("Disabling event %u", current_event->id);
current_event->disabled = 1;
}
@@ -346,7 +346,7 @@ static void reenable_events() {
if(ioctl(current_fd, PERF_EVENT_IOC_DISABLE, PERF_IOC_FLAG_GROUP) == -1
|| ioctl(current_fd, PERF_EVENT_IOC_ENABLE, PERF_IOC_FLAG_GROUP) == -1)
{
- error("Cannot reenable event group");
+ collector_error("Cannot reenable event group");
}
}
}
@@ -388,7 +388,7 @@ static int perf_collect() {
current_event->updated = 1;
}
else {
- error("Cannot update value for event %u", current_event->id);
+ collector_error("Cannot update value for event %u", current_event->id);
return 1;
}
}
@@ -1272,17 +1272,18 @@ void parse_command_line(int argc, char **argv) {
exit(1);
}
- error("ignoring parameter '%s'", argv[i]);
+ collector_error("ignoring parameter '%s'", argv[i]);
}
if(!plugin_enabled){
- info("no charts enabled - nothing to do.");
+ collector_info("no charts enabled - nothing to do.");
printf("DISABLE\n");
exit(1);
}
}
int main(int argc, char **argv) {
+ stderror = stderr;
clocks_init();
// ------------------------------------------------------------------------
@@ -1304,7 +1305,7 @@ int main(int argc, char **argv) {
if(freq >= update_every)
update_every = freq;
else if(freq)
- error("update frequency %d seconds is too small for PERF. Using %d.", freq, update_every);
+ collector_error("update frequency %d seconds is too small for PERF. Using %d.", freq, update_every);
if(unlikely(debug)) fprintf(stderr, "perf.plugin: calling perf_init()\n");
int perf = !perf_init();
@@ -1348,6 +1349,6 @@ int main(int argc, char **argv) {
if(now_monotonic_sec() - started_t > 14400) break;
}
- info("process exiting");
+ collector_info("process exiting");
perf_free();
}