Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-6.19-vsprintf-timespec64' into for-linus

+132 -154
+9 -2
Documentation/core-api/printk-formats.rst
··· 547 547 %pt[RT]s YYYY-mm-dd HH:MM:SS 548 548 %pt[RT]d YYYY-mm-dd 549 549 %pt[RT]t HH:MM:SS 550 - %pt[RT][dt][r][s] 550 + %ptSp <seconds>.<nanoseconds> 551 + %pt[RST][dt][r][s] 551 552 552 553 For printing date and time as represented by:: 553 554 554 - R struct rtc_time structure 555 + R content of struct rtc_time 556 + S content of struct timespec64 555 557 T time64_t type 556 558 557 559 in human readable format. ··· 564 562 The %pt[RT]s (space) will override ISO 8601 separator by using ' ' (space) 565 563 instead of 'T' (Capital T) between date and time. It won't have any effect 566 564 when date or time is omitted. 565 + 566 + The %ptSp is equivalent to %lld.%09ld for the content of the struct timespec64. 567 + When the other specifiers are given, it becomes the respective equivalent of 568 + %ptT[dt][r][s].%09ld. In other words, the seconds are being printed in 569 + the human readable format followed by a dot and nanoseconds. 567 570 568 571 Passed by reference. 569 572
+1 -2
drivers/char/ipmi/ipmi_si_intf.c
··· 275 275 struct timespec64 t; 276 276 277 277 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); 280 279 } 281 280 #else 282 281 #define debug_timestamp(smi_info, x)
+2 -4
drivers/char/ipmi/ipmi_ssif.c
··· 1083 1083 struct timespec64 t; 1084 1084 1085 1085 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); 1090 1088 } 1091 1089 return IPMI_CC_NO_ERROR; 1092 1090 }
+1 -1
drivers/dma-buf/sync_debug.c
··· 59 59 struct timespec64 ts64 = 60 60 ktime_to_timespec64(fence->timestamp); 61 61 62 - seq_printf(s, "@%lld.%09ld", (s64)ts64.tv_sec, ts64.tv_nsec); 62 + seq_printf(s, "@%ptSp", &ts64); 63 63 } 64 64 65 65 seq_printf(s, ": %lld", fence->seqno);
+1 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c
··· 217 217 drm_printf(&p, "version: " AMDGPU_COREDUMP_VERSION "\n"); 218 218 drm_printf(&p, "kernel: " UTS_RELEASE "\n"); 219 219 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); 222 221 223 222 if (coredump->reset_task_info.task.pid) 224 223 drm_printf(&p, "process_name: %s PID: %d\n",
+2 -4
drivers/gpu/drm/drm_vblank.c
··· 794 794 ts_vblank_time = ktime_to_timespec64(*vblank_time); 795 795 796 796 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, 801 799 duration_ns / 1000, i); 802 800 803 801 return true;
+1 -2
drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
··· 82 82 drm_printf(p, "kernel: " UTS_RELEASE "\n"); 83 83 drm_printf(p, "module: " KBUILD_MODNAME "\n"); 84 84 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); 87 86 88 87 list_for_each_entry_safe(block, tmp, &state->blocks, node) { 89 88 drm_printf(p, "====================%s================\n", block->name);
+1 -2
drivers/gpu/drm/msm/msm_gpu.c
··· 197 197 drm_printf(&p, "---\n"); 198 198 drm_printf(&p, "kernel: " UTS_RELEASE "\n"); 199 199 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); 202 201 if (state->comm) 203 202 drm_printf(&p, "comm: %s\n", state->comm); 204 203 if (state->cmd)
+2 -2
drivers/gpu/drm/xe/xe_devcoredump.c
··· 106 106 drm_puts(&p, "module: " KBUILD_MODNAME "\n"); 107 107 108 108 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); 110 110 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); 112 112 drm_printf(&p, "Process: %s [%d]\n", ss->process_name, ss->pid); 113 113 xe_device_snapshot_print(xe, &p); 114 114
+8 -12
drivers/mmc/core/mmc_test.c
··· 586 586 rate = mmc_test_rate(tot, &ts); 587 587 iops = mmc_test_rate(count * 100, &ts); /* I/O ops per sec x 100 */ 588 588 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); 597 594 598 595 mmc_test_save_transfer_result(test, count, sectors, ts, rate, iops); 599 596 } ··· 3071 3074 seq_printf(sf, "Test %d: %d\n", gr->testcase + 1, gr->result); 3072 3075 3073 3076 list_for_each_entry(tr, &gr->tr_lst, link) { 3074 - seq_printf(sf, "%u %d %llu.%09u %u %u.%02u\n", 3075 - tr->count, tr->sectors, 3076 - (u64)tr->ts.tv_sec, (u32)tr->ts.tv_nsec, 3077 - tr->rate, tr->iops / 100, tr->iops % 100); 3077 + seq_printf(sf, "%u %d %ptSp %u %u.%02u\n", 3078 + tr->count, tr->sectors, &tr->ts, tr->rate, 3079 + tr->iops / 100, tr->iops % 100); 3078 3080 } 3079 3081 } 3080 3082
+3 -5
drivers/net/dsa/sja1105/sja1105_tas.c
··· 775 775 base_time_ts = ns_to_timespec64(base_time); 776 776 now_ts = ns_to_timespec64(now); 777 777 778 - dev_dbg(ds->dev, "OPER base time %lld.%09ld (now %lld.%09ld)\n", 779 - base_time_ts.tv_sec, base_time_ts.tv_nsec, 780 - now_ts.tv_sec, now_ts.tv_nsec); 778 + dev_dbg(ds->dev, "OPER base time %ptSp (now %ptSp)\n", 779 + &base_time_ts, &now_ts); 781 780 782 781 break; 783 782 ··· 797 798 if (now < tas_data->oper_base_time) { 798 799 /* TAS has not started yet */ 799 800 diff = ns_to_timespec64(tas_data->oper_base_time - now); 800 - dev_dbg(ds->dev, "time to start: [%lld.%09ld]", 801 - diff.tv_sec, diff.tv_nsec); 801 + dev_dbg(ds->dev, "time to start: [%ptSp]", &diff); 802 802 break; 803 803 } 804 804
+2 -5
drivers/net/ethernet/intel/e1000e/ptp.c
··· 229 229 systim_overflow_work.work); 230 230 struct e1000_hw *hw = &adapter->hw; 231 231 struct timespec64 ts; 232 - u64 ns; 233 232 234 233 /* Update the timecounter */ 235 - ns = timecounter_read(&adapter->tc); 234 + ts = ns_to_timespec64(timecounter_read(&adapter->tc)); 236 235 237 - ts = ns_to_timespec64(ns); 238 - e_dbg("SYSTIM overflow check at %lld.%09lu\n", 239 - (long long) ts.tv_sec, ts.tv_nsec); 236 + e_dbg("SYSTIM overflow check at %ptSp\n", &ts); 240 237 241 238 schedule_delayed_work(&adapter->systim_overflow_work, 242 239 E1000_SYSTIM_OVERFLOW_PERIOD);
+2 -5
drivers/net/ethernet/intel/igb/igb_ptp.c
··· 840 840 struct igb_adapter *igb = 841 841 container_of(work, struct igb_adapter, ptp_overflow_work.work); 842 842 struct timespec64 ts; 843 - u64 ns; 844 843 845 844 /* Update the timecounter */ 846 - ns = timecounter_read(&igb->tc); 845 + ts = ns_to_timespec64(timecounter_read(&igb->tc)); 847 846 848 - ts = ns_to_timespec64(ns); 849 - pr_debug("igb overflow check at %lld.%09lu\n", 850 - (long long) ts.tv_sec, ts.tv_nsec); 847 + pr_debug("igb overflow check at %ptSp\n", &ts); 851 848 852 849 schedule_delayed_work(&igb->ptp_overflow_work, 853 850 IGB_SYSTIM_OVERFLOW_PERIOD);
+2 -3
drivers/pci/endpoint/functions/pci-epf-test.c
··· 326 326 rate = div64_u64(size * NSEC_PER_SEC, ns * 1000); 327 327 328 328 dev_info(&epf_test->epf->dev, 329 - "%s => Size: %llu B, DMA: %s, Time: %llu.%09u s, Rate: %llu KB/s\n", 330 - op, size, dma ? "YES" : "NO", 331 - (u64)ts.tv_sec, (u32)ts.tv_nsec, rate); 329 + "%s => Size: %llu B, DMA: %s, Time: %ptSp s, Rate: %llu KB/s\n", 330 + op, size, dma ? "YES" : "NO", &ts, rate); 332 331 } 333 332 334 333 static void pci_epf_test_copy(struct pci_epf_test *epf_test,
+1 -2
drivers/pps/generators/pps_gen_parport.c
··· 80 80 /* check if we are late */ 81 81 if (expire_time.tv_sec != ts1.tv_sec || ts1.tv_nsec > lim) { 82 82 local_irq_restore(flags); 83 - pr_err("we are late this time %lld.%09ld\n", 84 - (s64)ts1.tv_sec, ts1.tv_nsec); 83 + pr_err("we are late this time %ptSp\n", &ts1); 85 84 goto done; 86 85 } 87 86
+1 -2
drivers/pps/kapi.c
··· 166 166 /* check event type */ 167 167 BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); 168 168 169 - dev_dbg(&pps->dev, "PPS event at %lld.%09ld\n", 170 - (s64)ts->ts_real.tv_sec, ts->ts_real.tv_nsec); 169 + dev_dbg(&pps->dev, "PPS event at %ptSp\n", &ts->ts_real); 171 170 172 171 timespec_to_pps_ktime(&ts_real, ts->ts_real); 173 172
+5 -8
drivers/ptp/ptp_ocp.c
··· 4287 4287 ns += (s64)bp->utc_tai_offset * NSEC_PER_SEC; 4288 4288 sys_ts = ns_to_timespec64(ns); 4289 4289 4290 - seq_printf(s, "%7s: %lld.%ld == %ptT TAI\n", "PHC", 4291 - ts.tv_sec, ts.tv_nsec, &ts); 4292 - seq_printf(s, "%7s: %lld.%ld == %ptT UTC offset %d\n", "SYS", 4293 - sys_ts.tv_sec, sys_ts.tv_nsec, &sys_ts, 4294 - bp->utc_tai_offset); 4290 + seq_printf(s, "%7s: %ptSp == %ptS TAI\n", "PHC", &ts, &ts); 4291 + seq_printf(s, "%7s: %ptSp == %ptS UTC offset %d\n", "SYS", 4292 + &sys_ts, &sys_ts, bp->utc_tai_offset); 4295 4293 seq_printf(s, "%7s: PHC:SYS offset: %lld window: %lld\n", "", 4296 4294 timespec64_to_ns(&ts) - ns, 4297 4295 post_ns - pre_ns); ··· 4497 4499 ptp_clock_index(bp->ptp)); 4498 4500 4499 4501 if (!ptp_ocp_gettimex(&bp->ptp_info, &ts, NULL)) 4500 - dev_info(&bp->pdev->dev, "Time: %lld.%ld, %s\n", 4501 - ts.tv_sec, ts.tv_nsec, 4502 - bp->sync ? "in-sync" : "UNSYNCED"); 4502 + dev_info(&bp->pdev->dev, "Time: %ptSp, %s\n", 4503 + &ts, bp->sync ? "in-sync" : "UNSYNCED"); 4503 4504 } 4504 4505 4505 4506 static void
+1 -2
drivers/s390/block/dasd.c
··· 974 974 static void dasd_stats_seq_print(struct seq_file *m, 975 975 struct dasd_profile_info *data) 976 976 { 977 - seq_printf(m, "start_time %lld.%09ld\n", 978 - (s64)data->starttod.tv_sec, data->starttod.tv_nsec); 977 + seq_printf(m, "start_time %ptSp\n", &data->starttod); 979 978 seq_printf(m, "total_requests %u\n", data->dasd_io_reqs); 980 979 seq_printf(m, "total_sectors %u\n", data->dasd_io_sects); 981 980 seq_printf(m, "total_pav %u\n", data->dasd_io_alias);
+24 -31
drivers/scsi/fnic/fnic_trace.c
··· 138 138 */ 139 139 len += scnprintf(fnic_dbgfs_prt->buffer + len, 140 140 (trace_max_pages * PAGE_SIZE * 3) - len, 141 - "%16llu.%09lu %-50s %8x %8x %16llx %16llx " 142 - "%16llx %16llx %16llx\n", (u64)val.tv_sec, 143 - val.tv_nsec, str, tbp->host_no, tbp->tag, 141 + "%ptSp %-50s %8x %8x %16llx %16llx %16llx %16llx %16llx\n", 142 + &val, str, tbp->host_no, tbp->tag, 144 143 tbp->data[0], tbp->data[1], tbp->data[2], 145 144 tbp->data[3], tbp->data[4]); 146 145 rd_idx++; ··· 179 180 */ 180 181 len += scnprintf(fnic_dbgfs_prt->buffer + len, 181 182 (trace_max_pages * PAGE_SIZE * 3) - len, 182 - "%16llu.%09lu %-50s %8x %8x %16llx %16llx " 183 - "%16llx %16llx %16llx\n", (u64)val.tv_sec, 184 - val.tv_nsec, str, tbp->host_no, tbp->tag, 183 + "%ptSp %-50s %8x %8x %16llx %16llx %16llx %16llx %16llx\n", 184 + &val, str, tbp->host_no, tbp->tag, 185 185 tbp->data[0], tbp->data[1], tbp->data[2], 186 186 tbp->data[3], tbp->data[4]); 187 187 rd_idx++; ··· 213 215 { 214 216 int len = 0; 215 217 int buf_size = debug->buf_size; 216 - struct timespec64 val1, val2; 218 + struct timespec64 val, val1, val2; 217 219 int i = 0; 218 220 219 - ktime_get_real_ts64(&val1); 221 + ktime_get_real_ts64(&val); 220 222 len = scnprintf(debug->debug_buffer + len, buf_size - len, 221 223 "------------------------------------------\n" 222 224 "\t\tTime\n" 223 225 "------------------------------------------\n"); 224 226 227 + val1 = timespec64_sub(val, stats->stats_timestamps.last_reset_time); 228 + val2 = timespec64_sub(val, stats->stats_timestamps.last_read_time); 225 229 len += scnprintf(debug->debug_buffer + len, buf_size - len, 226 - "Current time : [%lld:%ld]\n" 227 - "Last stats reset time: [%lld:%09ld]\n" 228 - "Last stats read time: [%lld:%ld]\n" 229 - "delta since last reset: [%lld:%ld]\n" 230 - "delta since last read: [%lld:%ld]\n", 231 - (s64)val1.tv_sec, val1.tv_nsec, 232 - (s64)stats->stats_timestamps.last_reset_time.tv_sec, 233 - stats->stats_timestamps.last_reset_time.tv_nsec, 234 - (s64)stats->stats_timestamps.last_read_time.tv_sec, 235 - stats->stats_timestamps.last_read_time.tv_nsec, 236 - (s64)timespec64_sub(val1, stats->stats_timestamps.last_reset_time).tv_sec, 237 - timespec64_sub(val1, stats->stats_timestamps.last_reset_time).tv_nsec, 238 - (s64)timespec64_sub(val1, stats->stats_timestamps.last_read_time).tv_sec, 239 - timespec64_sub(val1, stats->stats_timestamps.last_read_time).tv_nsec); 230 + "Current time : [%ptSp]\n" 231 + "Last stats reset time: [%ptSp]\n" 232 + "Last stats read time: [%ptSp]\n" 233 + "delta since last reset: [%ptSp]\n" 234 + "delta since last read: [%ptSp]\n", 235 + &val, 236 + &stats->stats_timestamps.last_reset_time, 237 + &stats->stats_timestamps.last_read_time, 238 + &val1, &val2); 240 239 241 - stats->stats_timestamps.last_read_time = val1; 240 + stats->stats_timestamps.last_read_time = val; 242 241 243 242 len += scnprintf(debug->debug_buffer + len, buf_size - len, 244 243 "------------------------------------------\n" ··· 411 416 jiffies_to_timespec64(stats->misc_stats.last_ack_time, &val2); 412 417 413 418 len += scnprintf(debug->debug_buffer + len, buf_size - len, 414 - "Last ISR time: %llu (%8llu.%09lu)\n" 415 - "Last ACK time: %llu (%8llu.%09lu)\n" 419 + "Last ISR time: %llu (%ptSp)\n" 420 + "Last ACK time: %llu (%ptSp)\n" 416 421 "Max ISR jiffies: %llu\n" 417 422 "Max ISR time (ms) (0 denotes < 1 ms): %llu\n" 418 423 "Corr. work done: %llu\n" ··· 432 437 "Number of rport not ready: %lld\n" 433 438 "Number of receive frame errors: %lld\n" 434 439 "Port speed (in Mbps): %lld\n", 435 - (u64)stats->misc_stats.last_isr_time, 436 - (s64)val1.tv_sec, val1.tv_nsec, 437 - (u64)stats->misc_stats.last_ack_time, 438 - (s64)val2.tv_sec, val2.tv_nsec, 440 + (u64)stats->misc_stats.last_isr_time, &val1, 441 + (u64)stats->misc_stats.last_ack_time, &val2, 439 442 (u64)atomic64_read(&stats->misc_stats.max_isr_jiffies), 440 443 (u64)atomic64_read(&stats->misc_stats.max_isr_time_ms), 441 444 (u64)atomic64_read(&stats->misc_stats.corr_work_done), ··· 850 857 len = *orig_len; 851 858 852 859 len += scnprintf(fnic_dbgfs_prt->buffer + len, max_size - len, 853 - "%ptTs.%09lu ns%8x %c%8x\t", 854 - &tdata->time_stamp.tv_sec, tdata->time_stamp.tv_nsec, 860 + "%ptSs ns%8x %c%8x\t", 861 + &tdata->time_stamp, 855 862 tdata->host_no, tdata->frame_type, tdata->frame_len); 856 863 857 864 fc_trace = (char *)FC_TRACE_ADDRESS(tdata);
+4 -6
drivers/scsi/snic/snic_debugfs.c
··· 282 282 jiffies_to_timespec64(stats->misc.last_ack_time, &last_ack_tms); 283 283 284 284 seq_printf(sfp, 285 - "Last ISR Time : %llu (%8llu.%09lu)\n" 286 - "Last Ack Time : %llu (%8llu.%09lu)\n" 285 + "Last ISR Time : %llu (%ptSp)\n" 286 + "Last Ack Time : %llu (%ptSp)\n" 287 287 "Ack ISRs : %llu\n" 288 288 "IO Cmpl ISRs : %llu\n" 289 289 "Err Notify ISRs : %llu\n" ··· 298 298 "Queue Ramp Down : %lld\n" 299 299 "Queue Last Queue Depth : %lld\n" 300 300 "Target Not Ready : %lld\n", 301 - (u64) stats->misc.last_isr_time, 302 - last_isr_tms.tv_sec, last_isr_tms.tv_nsec, 303 - (u64)stats->misc.last_ack_time, 304 - last_ack_tms.tv_sec, last_ack_tms.tv_nsec, 301 + (u64) stats->misc.last_isr_time, &last_isr_tms, 302 + (u64) stats->misc.last_ack_time, &last_ack_tms, 305 303 (u64) atomic64_read(&stats->misc.ack_isr_cnt), 306 304 (u64) atomic64_read(&stats->misc.cmpl_isr_cnt), 307 305 (u64) atomic64_read(&stats->misc.errnotify_isr_cnt),
+2 -3
drivers/scsi/snic/snic_trc.c
··· 56 56 jiffies_to_timespec64(td->ts, &tmspec); 57 57 58 58 len += snprintf(buf, buf_sz, 59 - "%llu.%09lu %-25s %3d %4x %16llx %16llx %16llx %16llx %16llx\n", 60 - tmspec.tv_sec, 61 - tmspec.tv_nsec, 59 + "%ptSp %-25s %3d %4x %16llx %16llx %16llx %16llx %16llx\n", 60 + &tmspec, 62 61 td->fn, 63 62 td->hno, 64 63 td->tag,
+1 -1
drivers/staging/media/av7110/av7110.c
··· 321 321 struct timespec64 ts; 322 322 323 323 ktime_get_real_ts64(&ts); 324 - pr_info("%s(): %lld.%09ld\n", s, (s64)ts.tv_sec, ts.tv_nsec); 324 + pr_info("%s(): %ptSp\n", s, &ts); 325 325 #endif 326 326 } 327 327
+2 -3
fs/ceph/dir.c
··· 2156 2156 " rfiles: %20lld\n" 2157 2157 " rsubdirs: %20lld\n" 2158 2158 "rbytes: %20lld\n" 2159 - "rctime: %10lld.%09ld\n", 2159 + "rctime: %ptSp\n", 2160 2160 ci->i_files + ci->i_subdirs, 2161 2161 ci->i_files, 2162 2162 ci->i_subdirs, ··· 2164 2164 ci->i_rfiles, 2165 2165 ci->i_rsubdirs, 2166 2166 ci->i_rbytes, 2167 - ci->i_rctime.tv_sec, 2168 - ci->i_rctime.tv_nsec); 2167 + &ci->i_rctime); 2169 2168 } 2170 2169 2171 2170 if (*ppos >= dfi->dir_info_len)
+16 -33
fs/ceph/inode.c
··· 879 879 { 880 880 struct ceph_client *cl = ceph_inode_to_client(inode); 881 881 struct ceph_inode_info *ci = ceph_inode(inode); 882 + struct timespec64 iatime = inode_get_atime(inode); 882 883 struct timespec64 ictime = inode_get_ctime(inode); 884 + struct timespec64 imtime = inode_get_mtime(inode); 883 885 int warn = 0; 884 886 885 887 if (issued & (CEPH_CAP_FILE_EXCL| ··· 891 889 CEPH_CAP_XATTR_EXCL)) { 892 890 if (ci->i_version == 0 || 893 891 timespec64_compare(ctime, &ictime) > 0) { 894 - doutc(cl, "ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", 895 - ictime.tv_sec, ictime.tv_nsec, 896 - ctime->tv_sec, ctime->tv_nsec); 892 + doutc(cl, "ctime %ptSp -> %ptSp inc w/ cap\n", &ictime, ctime); 897 893 inode_set_ctime_to_ts(inode, *ctime); 898 894 } 899 895 if (ci->i_version == 0 || 900 896 ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { 901 897 /* the MDS did a utimes() */ 902 - doutc(cl, "mtime %lld.%09ld -> %lld.%09ld tw %d -> %d\n", 903 - inode_get_mtime_sec(inode), 904 - inode_get_mtime_nsec(inode), 905 - mtime->tv_sec, mtime->tv_nsec, 906 - ci->i_time_warp_seq, (int)time_warp_seq); 898 + doutc(cl, "mtime %ptSp -> %ptSp tw %d -> %d\n", &imtime, mtime, 899 + ci->i_time_warp_seq, (int)time_warp_seq); 907 900 908 901 inode_set_mtime_to_ts(inode, *mtime); 909 902 inode_set_atime_to_ts(inode, *atime); 910 903 ci->i_time_warp_seq = time_warp_seq; 911 904 } else if (time_warp_seq == ci->i_time_warp_seq) { 912 - struct timespec64 ts; 913 - 914 905 /* nobody did utimes(); take the max */ 915 - ts = inode_get_mtime(inode); 916 - if (timespec64_compare(mtime, &ts) > 0) { 917 - doutc(cl, "mtime %lld.%09ld -> %lld.%09ld inc\n", 918 - ts.tv_sec, ts.tv_nsec, 919 - mtime->tv_sec, mtime->tv_nsec); 906 + if (timespec64_compare(mtime, &imtime) > 0) { 907 + doutc(cl, "mtime %ptSp -> %ptSp inc\n", &imtime, mtime); 920 908 inode_set_mtime_to_ts(inode, *mtime); 921 909 } 922 - ts = inode_get_atime(inode); 923 - if (timespec64_compare(atime, &ts) > 0) { 924 - doutc(cl, "atime %lld.%09ld -> %lld.%09ld inc\n", 925 - ts.tv_sec, ts.tv_nsec, 926 - atime->tv_sec, atime->tv_nsec); 910 + if (timespec64_compare(atime, &iatime) > 0) { 911 + doutc(cl, "atime %ptSp -> %ptSp inc\n", &iatime, atime); 927 912 inode_set_atime_to_ts(inode, *atime); 928 913 } 929 914 } else if (issued & CEPH_CAP_FILE_EXCL) { ··· 2681 2692 if (ia_valid & ATTR_ATIME) { 2682 2693 struct timespec64 atime = inode_get_atime(inode); 2683 2694 2684 - doutc(cl, "%p %llx.%llx atime %lld.%09ld -> %lld.%09ld\n", 2685 - inode, ceph_vinop(inode), 2686 - atime.tv_sec, atime.tv_nsec, 2687 - attr->ia_atime.tv_sec, attr->ia_atime.tv_nsec); 2695 + doutc(cl, "%p %llx.%llx atime %ptSp -> %ptSp\n", 2696 + inode, ceph_vinop(inode), &atime, &attr->ia_atime); 2688 2697 if (!do_sync && (issued & CEPH_CAP_FILE_EXCL)) { 2689 2698 ci->i_time_warp_seq++; 2690 2699 inode_set_atime_to_ts(inode, attr->ia_atime); ··· 2756 2769 if (ia_valid & ATTR_MTIME) { 2757 2770 struct timespec64 mtime = inode_get_mtime(inode); 2758 2771 2759 - doutc(cl, "%p %llx.%llx mtime %lld.%09ld -> %lld.%09ld\n", 2760 - inode, ceph_vinop(inode), 2761 - mtime.tv_sec, mtime.tv_nsec, 2762 - attr->ia_mtime.tv_sec, attr->ia_mtime.tv_nsec); 2772 + doutc(cl, "%p %llx.%llx mtime %ptSp -> %ptSp\n", 2773 + inode, ceph_vinop(inode), &mtime, &attr->ia_mtime); 2763 2774 if (!do_sync && (issued & CEPH_CAP_FILE_EXCL)) { 2764 2775 ci->i_time_warp_seq++; 2765 2776 inode_set_mtime_to_ts(inode, attr->ia_mtime); ··· 2778 2793 2779 2794 /* these do nothing */ 2780 2795 if (ia_valid & ATTR_CTIME) { 2796 + struct timespec64 ictime = inode_get_ctime(inode); 2781 2797 bool only = (ia_valid & (ATTR_SIZE|ATTR_MTIME|ATTR_ATIME| 2782 2798 ATTR_MODE|ATTR_UID|ATTR_GID)) == 0; 2783 - doutc(cl, "%p %llx.%llx ctime %lld.%09ld -> %lld.%09ld (%s)\n", 2784 - inode, ceph_vinop(inode), 2785 - inode_get_ctime_sec(inode), 2786 - inode_get_ctime_nsec(inode), 2787 - attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, 2799 + doutc(cl, "%p %llx.%llx ctime %ptSp -> %ptSp (%s)\n", 2800 + inode, ceph_vinop(inode), &ictime, &attr->ia_ctime, 2788 2801 only ? "ctime only" : "ignored"); 2789 2802 if (only) { 2790 2803 /*
+2 -4
fs/ceph/xattr.c
··· 249 249 static ssize_t ceph_vxattrcb_dir_rctime(struct ceph_inode_info *ci, char *val, 250 250 size_t size) 251 251 { 252 - return ceph_fmt_xattr(val, size, "%lld.%09ld", ci->i_rctime.tv_sec, 253 - ci->i_rctime.tv_nsec); 252 + return ceph_fmt_xattr(val, size, "%ptSp", &ci->i_rctime); 254 253 } 255 254 256 255 /* dir pin */ ··· 306 307 static ssize_t ceph_vxattrcb_snap_btime(struct ceph_inode_info *ci, char *val, 307 308 size_t size) 308 309 { 309 - return ceph_fmt_xattr(val, size, "%lld.%09ld", ci->i_snap_btime.tv_sec, 310 - ci->i_snap_btime.tv_nsec); 310 + return ceph_fmt_xattr(val, size, "%ptSp", &ci->i_snap_btime); 311 311 } 312 312 313 313 static ssize_t ceph_vxattrcb_cluster_fsid(struct ceph_inode_info *ci,
+3 -3
kernel/trace/trace_output.c
··· 1467 1467 1468 1468 trace_assign_type(field, entry); 1469 1469 1470 - trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%lld.%09ld count:%d", 1470 + trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%ptSp count:%d", 1471 1471 field->seqnum, 1472 1472 field->duration, 1473 1473 field->outer_duration, 1474 - (long long)field->timestamp.tv_sec, 1475 - field->timestamp.tv_nsec, field->count); 1474 + &field->timestamp, 1475 + field->count); 1476 1476 1477 1477 if (field->nmi_count) { 1478 1478 /*
+4
lib/tests/printf_kunit.c
··· 504 504 }; 505 505 /* 2019-01-04T15:32:23 */ 506 506 time64_t t = 1546615943; 507 + struct timespec64 ts = { .tv_sec = t, .tv_nsec = 11235813 }; 507 508 508 509 test("(%pt?)", "%pt", &tm); 509 510 test("2018-11-26T05:35:43", "%ptR", &tm); ··· 523 522 test("0119-00-04 15:32:23", "%ptTsr", &t); 524 523 test("15:32:23|2019-01-04", "%ptTts|%ptTds", &t, &t); 525 524 test("15:32:23|0119-00-04", "%ptTtrs|%ptTdrs", &t, &t); 525 + 526 + test("2019-01-04T15:32:23.011235813", "%ptS", &ts); 527 + test("1546615943.011235813", "%ptSp", &ts); 526 528 } 527 529 528 530 static void
+27 -1
lib/vsprintf.c
··· 1984 1984 } 1985 1985 1986 1986 static noinline_for_stack 1987 + char *timespec64_str(char *buf, char *end, const struct timespec64 *ts, 1988 + struct printf_spec spec, const char *fmt) 1989 + { 1990 + static const struct printf_spec default_dec09_spec = { 1991 + .base = 10, 1992 + .field_width = 9, 1993 + .precision = -1, 1994 + .flags = ZEROPAD, 1995 + }; 1996 + 1997 + if (fmt[2] == 'p') 1998 + buf = number(buf, end, ts->tv_sec, default_dec_spec); 1999 + else 2000 + buf = time64_str(buf, end, ts->tv_sec, spec, fmt); 2001 + if (buf < end) 2002 + *buf = '.'; 2003 + buf++; 2004 + 2005 + return number(buf, end, ts->tv_nsec, default_dec09_spec); 2006 + } 2007 + 2008 + static noinline_for_stack 1987 2009 char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec, 1988 2010 const char *fmt) 1989 2011 { ··· 2015 1993 switch (fmt[1]) { 2016 1994 case 'R': 2017 1995 return rtc_str(buf, end, (const struct rtc_time *)ptr, spec, fmt); 1996 + case 'S': 1997 + return timespec64_str(buf, end, (const struct timespec64 *)ptr, spec, fmt); 2018 1998 case 'T': 2019 1999 return time64_str(buf, end, *(const time64_t *)ptr, spec, fmt); 2020 2000 default: ··· 2480 2456 * - 'd[234]' For a dentry name (optionally 2-4 last components) 2481 2457 * - 'D[234]' Same as 'd' but for a struct file 2482 2458 * - 'g' For block_device name (gendisk + partition number) 2483 - * - 't[RT][dt][r][s]' For time and date as represented by: 2459 + * - 't[RST][dt][r][s]' For time and date as represented by: 2484 2460 * R struct rtc_time 2461 + * S struct timespec64 2485 2462 * T time64_t 2463 + * - 'tSp' For time represented by struct timespec64 printed as <seconds>.<nanoseconds> 2486 2464 * - 'C' For a clock, it prints the name (Common Clock Framework) or address 2487 2465 * (legacy clock framework) of the clock 2488 2466 * - 'G' For flags to be printed as a collection of symbolic strings that would
+2 -4
net/ceph/messenger_v2.c
··· 1564 1564 struct timespec64 now; 1565 1565 1566 1566 ktime_get_real_ts64(&now); 1567 - dout("%s con %p timestamp %lld.%09ld\n", __func__, con, now.tv_sec, 1568 - now.tv_nsec); 1567 + dout("%s con %p timestamp %ptSp\n", __func__, con, &now); 1569 1568 1570 1569 ceph_encode_timespec64(ts, &now); 1571 1570 ··· 2758 2759 ceph_decode_need(&p, end, sizeof(struct ceph_timespec), bad); 2759 2760 ceph_decode_timespec64(&con->last_keepalive_ack, p); 2760 2761 2761 - dout("%s con %p timestamp %lld.%09ld\n", __func__, con, 2762 - con->last_keepalive_ack.tv_sec, con->last_keepalive_ack.tv_nsec); 2762 + dout("%s con %p timestamp %ptSp\n", __func__, con, &con->last_keepalive_ack); 2763 2763 2764 2764 return 0; 2765 2765