OSDN Git Service

cma: tracing: print alloc result in trace_cma_alloc_finish
authorWenchao Hao <haowenchao@huawei.com>
Thu, 8 Dec 2022 14:21:30 +0000 (22:21 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 19 Jan 2023 01:12:41 +0000 (17:12 -0800)
commitcb6c33d4dc09a8fddda1867708956c27615775f4
tree47b1e25350281eba57e44576c8d7813b65e2c9f8
parent6b1ead5985bf73b7dd4453f5cd3b8690a9c52cd5
cma: tracing: print alloc result in trace_cma_alloc_finish

The result of the allocation attempt is not printed in
trace_cma_alloc_finish, but it's important to do it so we can set filters
to catch specific errors on allocation or to trigger some operations on
specific errors.

We have printed the result in log, but the log is conditional and could
not be filtered by tracing events.

It introduces little overhead to print this result.  The result of
allocation is named `errorno' in the trace.

Link: https://lkml.kernel.org/r/20221208142130.1501195-1-haowenchao@huawei.com
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Cc: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/trace/events/cma.h
mm/cma.c