diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-08-04 10:11:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-08-04 10:31:28 +0200 |
commit | d511e8dca6dfd3ebae8f105d1eacfce392618055 (patch) | |
tree | 3bd24679d6f6daae32efdac430f7fdcdbeaab9dd /include/linux/printk.h | |
parent | df6b4cd7bf8917be7a1114d34b1a10dae82b93d5 (diff) | |
download | barebox-d511e8dca6dfd3ebae8f105d1eacfce392618055.tar.gz barebox-d511e8dca6dfd3ebae8f105d1eacfce392618055.tar.xz |
console: allocate only once instead of twice per log message
We do two allocations for each log message, one for the log message
string itself and another for the struct log_entry referencing it.
We could just make the log message directly follow the log entry and
save the space for the pointer and the time to do a second allocation.
No functional change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230804081147.559379-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index 76cdb15d5b..cd4c3cb68e 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -148,9 +148,9 @@ int __pr_memory_display(int level, const void *addr, loff_t offs, unsigned nbyte struct log_entry { struct list_head list; - char *msg; uint64_t timestamp; int level; + char msg[]; }; extern struct list_head barebox_logbuf; |