Skip to content

Commit

Permalink
rpmsg_ping.c: improve log level to LOG_EMERG
Browse files Browse the repository at this point in the history
Usually rpmsg ping logs are needed during testing,
but too many other module logs can easily overwrite it,
so improve the rpmsg ping log level, later we can setlogmask to
a higher log level to mask other modules' logs.

Signed-off-by: Yongrong Wang <[email protected]>
  • Loading branch information
wyr-7 authored and GUIDINGLI committed Oct 11, 2024
1 parent b96ad59 commit 1cf97ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/rpmsg/rpmsg_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ static void rpmsg_ping_logout(FAR const char *s, clock_t value)
perf_convert(value, &ts);

#ifdef CONFIG_SYSTEM_TIME64
syslog(LOG_INFO, "%s: %" PRIu64 " s, %ld ns\n", s, ts.tv_sec, ts.tv_nsec);
syslog(LOG_EMERG, "%s: %" PRIu64 " s, %ld ns\n", s, ts.tv_sec, ts.tv_nsec);
#else
syslog(LOG_INFO, "%s: %" PRIu32 " s, %ld ns\n", s, ts.tv_sec, ts.tv_nsec);
syslog(LOG_EMERG, "%s: %" PRIu32 " s, %ld ns\n", s, ts.tv_sec, ts.tv_nsec);
#endif
}

Expand All @@ -200,7 +200,7 @@ static void rpmsg_ping_logout_rate(uint64_t len, clock_t avg)
rateint = ratebits / 1000000;
ratedec = ratebits - rateint * 1000000;

syslog(LOG_INFO, "rate: %zu.%06zu Mbits/sec\n", rateint, ratedec);
syslog(LOG_EMERG, "rate: %zu.%06zu Mbits/sec\n", rateint, ratedec);
}

/****************************************************************************
Expand Down Expand Up @@ -243,7 +243,9 @@ int rpmsg_ping(FAR struct rpmsg_endpoint *ept,
}
}

syslog(LOG_INFO, "ping times: %d\n", ping->times);
syslog(LOG_EMERG, "ping times: %d\n", ping->times);
syslog(LOG_EMERG, "buffer_len: %" PRIu32 ", send_len: %d\n",
buf_len, send_len);

rpmsg_ping_logout("avg", total / ping->times);
rpmsg_ping_logout("min", min);
Expand Down

0 comments on commit 1cf97ac

Please sign in to comment.