summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2025-04-03 21:06:37 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2025-05-06 11:35:34 -0400
commit872a0d90c1297a560b0fbee219dc5ef6eda9bcb4 (patch)
tree8b7dcc92d02e96b5776bc7d9442d0c49bab685bd /tools/perf/scripts/python/export-to-postgresql.py
parent3e4b37160b43a24ceda672033864c594d1f5cd8b (diff)
tracing: Always use memcpy() in histogram add_to_key()
The add_to_key() function tests if the key is a string or some data. If it's a string it does some further calculations of the string size (still truncating it to the max size it can be), and calls strncpy(). If the key isn't as string it calls memcpy(). The interesting point is that both use the exact same parameters: strncpy(compound_key + key_field->offset, (char *)key, size); } else memcpy(compound_key + key_field->offset, key, size); As strncpy() is being used simply as a memcpy() for a string, and since strncpy() is deprecated, just call memcpy() for both memory and string keys. Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/20250403210637.1c477d4a@gandalf.local.home Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Tom Zanussi <zanussi@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions