Skip to content

Commit cf835bf

Browse files
committed
fixed mixed output of adapter and regular traces
Fixed #2002 issue. Regular UR tracing prints now calls in two separate lines like PI does.
1 parent 9ca3ec7 commit cf835bf

File tree

3 files changed

+2569
-1015
lines changed

3 files changed

+2569
-1015
lines changed

scripts/templates/trcddi.cpp.mako

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,22 @@ namespace ur_tracing_layer
4646
uint64_t instance = getContext()->notify_begin(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", &params);
4747

4848
auto &logger = getContext()->logger;
49+
const bool should_log = (logger.getLevel() <= logger::Level::INFO);
4950

50-
logger.info("---> ${th.make_func_name(n, tags, obj)}");
51+
if (should_log) {
52+
std::ostringstream args_str_before;
53+
ur::extras::printFunctionParams(args_str_before, ${th.make_func_etor(n, tags, obj)}, &params);
54+
logger.info(" ---> ${th.make_func_name(n, tags, obj)}({})\n", args_str_before.str());
55+
}
5156

5257
${x}_result_t result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} );
5358

5459
getContext()->notify_end(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", &params, &result, instance);
5560

56-
if (logger.getLevel() <= logger::Level::INFO) {
57-
std::ostringstream args_str;
58-
ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, &params);
59-
logger.info("({}) -> {};\n", args_str.str(), result);
61+
if (should_log) {
62+
std::ostringstream args_str_after;
63+
ur::extras::printFunctionParams(args_str_after, ${th.make_func_etor(n, tags, obj)}, &params);
64+
logger.info(" <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str_after.str(), result);
6065
}
6166

6267
return result;

0 commit comments

Comments
 (0)