···547547 %pt[RT]s YYYY-mm-dd HH:MM:SS548548 %pt[RT]d YYYY-mm-dd549549 %pt[RT]t HH:MM:SS550550- %pt[RT][dt][r][s]550550+ %ptSp <seconds>.<nanoseconds>551551+ %pt[RST][dt][r][s]551552552553For printing date and time as represented by::553554554554- R struct rtc_time structure555555+ R content of struct rtc_time556556+ S content of struct timespec64555557 T time64_t type556558557559in human readable format.···564562The %pt[RT]s (space) will override ISO 8601 separator by using ' ' (space)565563instead of 'T' (Capital T) between date and time. It won't have any effect566564when date or time is omitted.565565+566566+The %ptSp is equivalent to %lld.%09ld for the content of the struct timespec64.567567+When the other specifiers are given, it becomes the respective equivalent of568568+%ptT[dt][r][s].%09ld. In other words, the seconds are being printed in569569+the human readable format followed by a dot and nanoseconds.567570568571Passed by reference.569572
···8080 /* check if we are late */8181 if (expire_time.tv_sec != ts1.tv_sec || ts1.tv_nsec > lim) {8282 local_irq_restore(flags);8383- pr_err("we are late this time %lld.%09ld\n",8484- (s64)ts1.tv_sec, ts1.tv_nsec);8383+ pr_err("we are late this time %ptSp\n", &ts1);8584 goto done;8685 }8786
+1-2
drivers/pps/kapi.c
···166166 /* check event type */167167 BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);168168169169- dev_dbg(&pps->dev, "PPS event at %lld.%09ld\n",170170- (s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec);169169+ dev_dbg(&pps->dev, "PPS event at %ptSp\n", &ts->ts_real);171170172171 timespec_to_pps_ktime(&ts_real, ts->ts_real);173172
···19841984}1985198519861986static noinline_for_stack19871987+char *timespec64_str(char *buf, char *end, const struct timespec64 *ts,19881988+ struct printf_spec spec, const char *fmt)19891989+{19901990+ static const struct printf_spec default_dec09_spec = {19911991+ .base = 10,19921992+ .field_width = 9,19931993+ .precision = -1,19941994+ .flags = ZEROPAD,19951995+ };19961996+19971997+ if (fmt[2] == 'p')19981998+ buf = number(buf, end, ts->tv_sec, default_dec_spec);19991999+ else20002000+ buf = time64_str(buf, end, ts->tv_sec, spec, fmt);20012001+ if (buf < end)20022002+ *buf = '.';20032003+ buf++;20042004+20052005+ return number(buf, end, ts->tv_nsec, default_dec09_spec);20062006+}20072007+20082008+static noinline_for_stack19872009char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec,19882010 const char *fmt)19892011{···20151993 switch (fmt[1]) {20161994 case 'R':20171995 return rtc_str(buf, end, (const struct rtc_time *)ptr, spec, fmt);19961996+ case 'S':19971997+ return timespec64_str(buf, end, (const struct timespec64 *)ptr, spec, fmt);20181998 case 'T':20191999 return time64_str(buf, end, *(const time64_t *)ptr, spec, fmt);20202000 default:···24802456 * - 'd[234]' For a dentry name (optionally 2-4 last components)24812457 * - 'D[234]' Same as 'd' but for a struct file24822458 * - 'g' For block_device name (gendisk + partition number)24832483- * - 't[RT][dt][r][s]' For time and date as represented by:24592459+ * - 't[RST][dt][r][s]' For time and date as represented by:24842460 * R struct rtc_time24612461+ * S struct timespec6424852462 * T time64_t24632463+ * - 'tSp' For time represented by struct timespec64 printed as <seconds>.<nanoseconds>24862464 * - 'C' For a clock, it prints the name (Common Clock Framework) or address24872465 * (legacy clock framework) of the clock24882466 * - 'G' For flags to be printed as a collection of symbolic strings that would