[06/10] time_stats: allow custom epoch names
Commit Message
From: Darrick J. Wong <djwong@kernel.org>
Let callers of time_stats_to_seq_buf define the epoch name; "mount"
doesn't make sense generally.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
---
include/linux/time_stats.h | 2 +-
lib/time_stats.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -151,7 +151,7 @@ static inline bool track_event_change(struct time_stats *stats, bool v)
#define TIME_STATS_PRINT_NO_ZEROES (1U << 0) /* print nothing if zero count */
struct seq_buf;
void time_stats_to_seq_buf(struct seq_buf *, struct time_stats *,
- unsigned int flags);
+ const char *epoch_name, unsigned int flags);
void time_stats_exit(struct time_stats *);
void time_stats_init(struct time_stats *);
@@ -169,7 +169,7 @@ static inline u64 time_stats_lifetime(const struct time_stats *stats)
}
void time_stats_to_seq_buf(struct seq_buf *out, struct time_stats *stats,
- unsigned int flags)
+ const char *epoch_name, unsigned int flags)
{
struct quantiles *quantiles = time_stats_to_quantiles(stats);
s64 f_mean = 0, d_mean = 0;
@@ -201,7 +201,7 @@ void time_stats_to_seq_buf(struct seq_buf *out, struct time_stats *stats,
seq_buf_time_units_aligned(out, lifetime);
seq_buf_printf(out, "\n");
- seq_buf_printf(out, " since mount recent\n");
+ seq_buf_printf(out, " since %-12s recent\n", epoch_name);
seq_buf_printf(out, "duration of events\n");