Commit 33e4b29f authored by Breno Leitao's avatar Breno Leitao Committed by Paolo Abeni
Browse files

netconsole: add taskname to extradata entry count



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: default avatarBreno Leitao <leitao@debian.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 4d989521
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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),
};

/**
@@ -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;
}