Skip to content

Commit 3869e43

Browse files
committed
Merge branch 'for-6.19-vsprintf-timespec64' into for-linus
2 parents a9f349e + ace3852 commit 3869e43

29 files changed

Lines changed: 133 additions & 155 deletions

File tree

Documentation/core-api/printk-formats.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,13 @@ Time and date
547547
%pt[RT]s YYYY-mm-dd HH:MM:SS
548548
%pt[RT]d YYYY-mm-dd
549549
%pt[RT]t HH:MM:SS
550-
%pt[RT][dt][r][s]
550+
%ptSp <seconds>.<nanoseconds>
551+
%pt[RST][dt][r][s]
551552

552553
For printing date and time as represented by::
553554

554-
R struct rtc_time structure
555+
R content of struct rtc_time
556+
S content of struct timespec64
555557
T time64_t type
556558

557559
in human readable format.
@@ -563,6 +565,11 @@ The %pt[RT]s (space) will override ISO 8601 separator by using ' ' (space)
563565
instead of 'T' (Capital T) between date and time. It won't have any effect
564566
when date or time is omitted.
565567

568+
The %ptSp is equivalent to %lld.%09ld for the content of the struct timespec64.
569+
When the other specifiers are given, it becomes the respective equivalent of
570+
%ptT[dt][r][s].%09ld. In other words, the seconds are being printed in
571+
the human readable format followed by a dot and nanoseconds.
572+
566573
Passed by reference.
567574

568575
struct clk

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ void debug_timestamp(struct smi_info *smi_info, char *msg)
275275
struct timespec64 t;
276276

277277
ktime_get_ts64(&t);
278-
dev_dbg(smi_info->io.dev, "**%s: %lld.%9.9ld\n",
279-
msg, t.tv_sec, t.tv_nsec);
278+
dev_dbg(smi_info->io.dev, "**%s: %ptSp\n", msg, &t);
280279
}
281280
#else
282281
#define debug_timestamp(smi_info, x)

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,8 @@ static int sender(void *send_info, struct ipmi_smi_msg *msg)
10831083
struct timespec64 t;
10841084

10851085
ktime_get_real_ts64(&t);
1086-
dev_dbg(&ssif_info->client->dev,
1087-
"**Enqueue %02x %02x: %lld.%6.6ld\n",
1088-
msg->data[0], msg->data[1],
1089-
(long long)t.tv_sec, (long)t.tv_nsec / NSEC_PER_USEC);
1086+
dev_dbg(&ssif_info->client->dev, "**Enqueue %02x %02x: %ptSp\n",
1087+
msg->data[0], msg->data[1], &t);
10901088
}
10911089
return IPMI_CC_NO_ERROR;
10921090
}

drivers/dma-buf/sync_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static void sync_print_fence(struct seq_file *s,
5959
struct timespec64 ts64 =
6060
ktime_to_timespec64(fence->timestamp);
6161

62-
seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec);
62+
seq_printf(s, "@%ptSp", &ts64);
6363
}
6464

6565
seq_printf(s, ": %lld", fence->seqno);

drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,
217217
drm_printf(&p, "version: " AMDGPU_COREDUMP_VERSION "\n");
218218
drm_printf(&p, "kernel: " UTS_RELEASE "\n");
219219
drm_printf(&p, "module: " KBUILD_MODNAME "\n");
220-
drm_printf(&p, "time: %lld.%09ld\n", coredump->reset_time.tv_sec,
221-
coredump->reset_time.tv_nsec);
220+
drm_printf(&p, "time: %ptSp\n", &coredump->reset_time);
222221

223222
if (coredump->reset_task_info.task.pid)
224223
drm_printf(&p, "process_name: %s PID: %d\n",

drivers/gpu/drm/drm_vblank.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,8 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
794794
ts_vblank_time = ktime_to_timespec64(*vblank_time);
795795

796796
drm_dbg_vbl(dev,
797-
"crtc %u : v p(%d,%d)@ %lld.%06ld -> %lld.%06ld [e %d us, %d rep]\n",
798-
pipe, hpos, vpos,
799-
(u64)ts_etime.tv_sec, ts_etime.tv_nsec / 1000,
800-
(u64)ts_vblank_time.tv_sec, ts_vblank_time.tv_nsec / 1000,
797+
"crtc %u : v p(%d,%d)@ %ptSp -> %ptSp [e %d us, %d rep]\n",
798+
pipe, hpos, vpos, &ts_etime, &ts_vblank_time,
801799
duration_ns / 1000, i);
802800

803801
return true;

drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ void msm_disp_state_print(struct msm_disp_state *state, struct drm_printer *p)
8282
drm_printf(p, "kernel: " UTS_RELEASE "\n");
8383
drm_printf(p, "module: " KBUILD_MODNAME "\n");
8484
drm_printf(p, "dpu devcoredump\n");
85-
drm_printf(p, "time: %lld.%09ld\n",
86-
state->time.tv_sec, state->time.tv_nsec);
85+
drm_printf(p, "time: %ptSp\n", &state->time);
8786

8887
list_for_each_entry_safe(block, tmp, &state->blocks, node) {
8988
drm_printf(p, "====================%s================\n", block->name);

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset,
197197
drm_printf(&p, "---\n");
198198
drm_printf(&p, "kernel: " UTS_RELEASE "\n");
199199
drm_printf(&p, "module: " KBUILD_MODNAME "\n");
200-
drm_printf(&p, "time: %lld.%09ld\n",
201-
state->time.tv_sec, state->time.tv_nsec);
200+
drm_printf(&p, "time: %ptSp\n", &state->time);
202201
if (state->comm)
203202
drm_printf(&p, "comm: %s\n", state->comm);
204203
if (state->cmd)

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ static ssize_t __xe_devcoredump_read(char *buffer, ssize_t count,
106106
drm_puts(&p, "module: " KBUILD_MODNAME "\n");
107107

108108
ts = ktime_to_timespec64(ss->snapshot_time);
109-
drm_printf(&p, "Snapshot time: %lld.%09ld\n", ts.tv_sec, ts.tv_nsec);
109+
drm_printf(&p, "Snapshot time: %ptSp\n", &ts);
110110
ts = ktime_to_timespec64(ss->boot_time);
111-
drm_printf(&p, "Uptime: %lld.%09ld\n", ts.tv_sec, ts.tv_nsec);
111+
drm_printf(&p, "Uptime: %ptSp\n", &ts);
112112
drm_printf(&p, "Process: %s [%d]\n", ss->process_name, ss->pid);
113113
xe_device_snapshot_print(xe, &p);
114114

drivers/mmc/core/mmc_test.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,11 @@ static void mmc_test_print_avg_rate(struct mmc_test_card *test, uint64_t bytes,
586586
rate = mmc_test_rate(tot, &ts);
587587
iops = mmc_test_rate(count * 100, &ts); /* I/O ops per sec x 100 */
588588

589-
pr_info("%s: Transfer of %u x %u sectors (%u x %u%s KiB) took "
590-
"%llu.%09u seconds (%u kB/s, %u KiB/s, "
591-
"%u.%02u IOPS, sg_len %d)\n",
592-
mmc_hostname(test->card->host), count, sectors, count,
593-
sectors >> 1, (sectors & 1 ? ".5" : ""),
594-
(u64)ts.tv_sec, (u32)ts.tv_nsec,
595-
rate / 1000, rate / 1024, iops / 100, iops % 100,
596-
test->area.sg_len);
589+
pr_info("%s: Transfer of %u x %u sectors (%u x %u%s KiB) took %ptSp seconds (%u kB/s, %u KiB/s, %u.%02u IOPS, sg_len %d)\n",
590+
mmc_hostname(test->card->host), count, sectors, count,
591+
sectors >> 1, (sectors & 1 ? ".5" : ""), &ts,
592+
rate / 1000, rate / 1024, iops / 100, iops % 100,
593+
test->area.sg_len);
597594

598595
mmc_test_save_transfer_result(test, count, sectors, ts, rate, iops);
599596
}
@@ -3074,10 +3071,9 @@ static int mtf_test_show(struct seq_file *sf, void *data)
30743071
seq_printf(sf, "Test %d: %d\n", gr->testcase + 1, gr->result);
30753072

30763073
list_for_each_entry(tr, &gr->tr_lst, link) {
3077-
seq_printf(sf, "%u %d %llu.%09u %u %u.%02u\n",
3078-
tr->count, tr->sectors,
3079-
(u64)tr->ts.tv_sec, (u32)tr->ts.tv_nsec,
3080-
tr->rate, tr->iops / 100, tr->iops % 100);
3074+
seq_printf(sf, "%u %d %ptSp %u %u.%02u\n",
3075+
tr->count, tr->sectors, &tr->ts, tr->rate,
3076+
tr->iops / 100, tr->iops % 100);
30813077
}
30823078
}
30833079

0 commit comments

Comments
 (0)