From 53689418c201f6c8332fe2bb864a6365ae00b514 Mon Sep 17 00:00:00 2001
From: Philipp Hahn
Date: Tue, 29 Sep 2026 12:25:10 +0200
Subject: [PATCH] callgrind: Redirect output to stderr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Compiling the Linux kernel with `MAKE='remake --profile'` breaks as the
output of some targets is captured and post-processed. Enabling
profiling clutters that output, which is also captured and then leads to
strange failures:
$ less build/avm/make/generated/kernelversion.make
kernelversion = 6.6.121
kernelversion = Created callgrind profiling data file: …/profile/callgrind.out.1083
Redirect all error messages and the final line to stderr to not clutter
stdout.
Signed-off-by: Philipp Hahn
---
src/callgrind_format.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/callgrind_format.c b/src/callgrind_format.c
index 42b80fbae..78794d0f0 100644
--- a/src/callgrind_format.c
+++ b/src/callgrind_format.c
@@ -53,13 +53,13 @@ callgrind_init(profile_context_t *ctx, const char *creator, const char *const *a
len = sprintf(callgrind_fname, CALLGRIND_FILE_TEMPLATE, ctx->output_dir, ctx->pid);
if (len >= CALLGRIND_FILENAME_LEN) {
- printf("Error in generating callgrind name\n");
+ fprintf(stderr, "Error in generating callgrind name\n");
return false;
}
callgrind_fd = fopen(callgrind_fname, "w");
if (NULL == callgrind_fd) {
- printf("Error in opening callgrind file %s\n", callgrind_fname);
+ fprintf(stderr, "Error in opening callgrind file %s\n", callgrind_fname);
return false;
}
@@ -119,5 +119,5 @@ callgrind_close(profile_context_t *ctx, const char *program_status) {
profile_dump_entries(callgrind_profile_entry);
fclose(callgrind_fd);
- printf("Created callgrind profiling data file: %s\n", callgrind_fname);
+ fprintf(stderr, "Created callgrind profiling data file: %s\n", callgrind_fname);
}