From d079b656b4719739b2247dcd9d46e9bec793095a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 Feb 2023 17:11:34 +0100 Subject: Merging upstream version 1.38.0. Signed-off-by: Daniel Baumann --- collectors/perf.plugin/README.md | 8 ++++++-- collectors/perf.plugin/perf_plugin.c | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'collectors/perf.plugin') diff --git a/collectors/perf.plugin/README.md b/collectors/perf.plugin/README.md index a7a87aca2..9e114363d 100644 --- a/collectors/perf.plugin/README.md +++ b/collectors/perf.plugin/README.md @@ -1,6 +1,10 @@ # perf.plugin diff --git a/collectors/perf.plugin/perf_plugin.c b/collectors/perf.plugin/perf_plugin.c index b2f7d2e17..68c0f917d 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(); } -- cgit v1.2.3