Skip to content

Commit

Permalink
netconsole: add taskname to extradata entry count
Browse files Browse the repository at this point in the history
New SYSDATA_TASKNAME feature flag to track when taskname append is enabled.

Additional check in count_extradata_entries() to include taskname in
total, counting it as an entry in extradata. This function is used to
check if we are not overflowing the number of extradata items.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Breno Leitao authored and Paolo Abeni committed Mar 4, 2025
1 parent 4d98952 commit 33e4b29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ struct netconsole_target_stats {
enum sysdata_feature {
/* Populate the CPU that sends the message */
SYSDATA_CPU_NR = BIT(0),
/* Populate the task name (as in current->comm) in sysdata */
SYSDATA_TASKNAME = BIT(1),
};

/**
Expand Down Expand Up @@ -701,6 +703,8 @@ static size_t count_extradata_entries(struct netconsole_target *nt)
/* Plus sysdata entries */
if (nt->sysdata_fields & SYSDATA_CPU_NR)
entries += 1;
if (nt->sysdata_fields & SYSDATA_TASKNAME)
entries += 1;

return entries;
}
Expand Down

0 comments on commit 33e4b29

Please sign in to comment.