commit fd2706c231aea0dbe6092de77ab123e47ce22849
parent 7b508fec7d430478e9c4d534ce0f7fa9d461f2bc
Author: sin <sin@2f30.org>
Date: Sun, 4 Aug 2013 17:38:46 +0100
Include both the process name and the pid in debug output
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lemoncake.c b/lemoncake.c
@@ -411,14 +411,12 @@ dumpstats(void)
{
int fd;
struct node *n;
- char *p;
fd = open("lemoncake.out", O_WRONLY | O_CREAT | O_APPEND, 0644);
if (fd < 0)
return;
- p = getenv("_");
- if (p)
- writelog(fd, "*** Lemoncake stats for process: %s ***\n", p);
+ writelog(fd, "*** Lemoncake stats [process: %s pid: %lu] ***\n",
+ getenv("_") ? getenv("_") : "<unknown>", (unsigned long)getpid());
writelog(fd, "Number of sbrk calls: %lu\n", st.nr_sbrk);
writelog(fd, "Number of mmap calls: %lu\n", st.nr_mmap);
writelog(fd, "Number of malloc calls: %lu\n", st.nr_malloc);