Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
80ae5529
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
80ae5529
编写于
6月 29, 2021
作者:
P
Petr Mladek
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-5.14-vsprintf-pts' into for-linus
上级
4249cb7d
2f9e0f8c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
35 deletion
+33
-35
Documentation/core-api/printk-formats.rst
Documentation/core-api/printk-formats.rst
+6
-1
drivers/usb/host/xhci-tegra.c
drivers/usb/host/xhci-tegra.c
+1
-5
fs/nilfs2/sysfs.c
fs/nilfs2/sysfs.c
+3
-16
kernel/debug/kdb/kdb_main.c
kernel/debug/kdb/kdb_main.c
+1
-8
lib/test_printf.c
lib/test_printf.c
+5
-0
lib/vsprintf.c
lib/vsprintf.c
+17
-5
未找到文件。
Documentation/core-api/printk-formats.rst
浏览文件 @
80ae5529
...
...
@@ -514,9 +514,10 @@ Time and date
::
%pt[RT] YYYY-mm-ddTHH:MM:SS
%pt[RT]s YYYY-mm-dd HH:MM:SS
%pt[RT]d YYYY-mm-dd
%pt[RT]t HH:MM:SS
%pt[RT][dt][r]
%pt[RT][dt][r]
[s]
For printing date and time as represented by::
...
...
@@ -528,6 +529,10 @@ in human readable format.
By default year will be incremented by 1900 and month by 1.
Use %pt[RT]r (raw) to suppress this behaviour.
The %pt[RT]s (space) will override ISO 8601 separator by using ' ' (space)
instead of 'T' (Capital T) between date and time. It won't have any effect
when date or time is omitted.
Passed by reference.
struct clk
...
...
drivers/usb/host/xhci-tegra.c
浏览文件 @
80ae5529
...
...
@@ -917,7 +917,6 @@ static int tegra_xusb_load_firmware(struct tegra_xusb *tegra)
struct
xhci_op_regs
__iomem
*
op
;
unsigned
long
timeout
;
time64_t
timestamp
;
struct
tm
time
;
u64
address
;
u32
value
;
int
err
;
...
...
@@ -1014,11 +1013,8 @@ static int tegra_xusb_load_firmware(struct tegra_xusb *tegra)
}
timestamp
=
le32_to_cpu
(
header
->
fwimg_created_time
);
time64_to_tm
(
timestamp
,
0
,
&
time
);
dev_info
(
dev
,
"Firmware timestamp: %ld-%02d-%02d %02d:%02d:%02d UTC
\n
"
,
time
.
tm_year
+
1900
,
time
.
tm_mon
+
1
,
time
.
tm_mday
,
time
.
tm_hour
,
time
.
tm_min
,
time
.
tm_sec
);
dev_info
(
dev
,
"Firmware timestamp: %ptTs UTC
\n
"
,
&
timestamp
);
return
0
;
}
...
...
fs/nilfs2/sysfs.c
浏览文件 @
80ae5529
...
...
@@ -19,19 +19,6 @@
/* /sys/fs/<nilfs>/ */
static
struct
kset
*
nilfs_kset
;
#define NILFS_SHOW_TIME(time_t_val, buf) ({ \
struct tm res; \
int count = 0; \
time64_to_tm(time_t_val, 0, &res); \
res.tm_year += 1900; \
res.tm_mon += 1; \
count = scnprintf(buf, PAGE_SIZE, \
"%ld-%.2d-%.2d %.2d:%.2d:%.2d\n", \
res.tm_year, res.tm_mon, res.tm_mday, \
res.tm_hour, res.tm_min, res.tm_sec);\
count; \
})
#define NILFS_DEV_INT_GROUP_OPS(name, parent_name) \
static ssize_t nilfs_##name##_attr_show(struct kobject *kobj, \
struct attribute *attr, char *buf) \
...
...
@@ -576,7 +563,7 @@ nilfs_segctor_last_seg_write_time_show(struct nilfs_segctor_attr *attr,
ctime
=
nilfs
->
ns_ctime
;
up_read
(
&
nilfs
->
ns_segctor_sem
);
return
NILFS_SHOW_TIME
(
ctime
,
buf
);
return
sysfs_emit
(
buf
,
"%ptTs
\n
"
,
&
ctime
);
}
static
ssize_t
...
...
@@ -604,7 +591,7 @@ nilfs_segctor_last_nongc_write_time_show(struct nilfs_segctor_attr *attr,
nongc_ctime
=
nilfs
->
ns_nongc_ctime
;
up_read
(
&
nilfs
->
ns_segctor_sem
);
return
NILFS_SHOW_TIME
(
nongc_ctime
,
buf
);
return
sysfs_emit
(
buf
,
"%ptTs
\n
"
,
&
nongc_ctime
);
}
static
ssize_t
...
...
@@ -724,7 +711,7 @@ nilfs_superblock_sb_write_time_show(struct nilfs_superblock_attr *attr,
sbwtime
=
nilfs
->
ns_sbwtime
;
up_read
(
&
nilfs
->
ns_sem
);
return
NILFS_SHOW_TIME
(
sbwtime
,
buf
);
return
sysfs_emit
(
buf
,
"%ptTs
\n
"
,
&
sbwtime
);
}
static
ssize_t
...
...
kernel/debug/kdb/kdb_main.c
浏览文件 @
80ae5529
...
...
@@ -2488,7 +2488,6 @@ static void kdb_sysinfo(struct sysinfo *val)
static
int
kdb_summary
(
int
argc
,
const
char
**
argv
)
{
time64_t
now
;
struct
tm
tm
;
struct
sysinfo
val
;
if
(
argc
)
...
...
@@ -2502,13 +2501,7 @@ static int kdb_summary(int argc, const char **argv)
kdb_printf
(
"domainname %s
\n
"
,
init_uts_ns
.
name
.
domainname
);
now
=
__ktime_get_real_seconds
();
time64_to_tm
(
now
,
0
,
&
tm
);
kdb_printf
(
"date %04ld-%02d-%02d %02d:%02d:%02d "
"tz_minuteswest %d
\n
"
,
1900
+
tm
.
tm_year
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
,
sys_tz
.
tz_minuteswest
);
kdb_printf
(
"date %ptTs tz_minuteswest %d
\n
"
,
&
now
,
sys_tz
.
tz_minuteswest
);
kdb_sysinfo
(
&
val
);
kdb_printf
(
"uptime "
);
if
(
val
.
uptime
>
(
24
*
60
*
60
))
{
...
...
lib/test_printf.c
浏览文件 @
80ae5529
...
...
@@ -528,6 +528,11 @@ time_and_date(void)
test
(
"0119-00-04T15:32:23"
,
"%ptTr"
,
&
t
);
test
(
"15:32:23|2019-01-04"
,
"%ptTt|%ptTd"
,
&
t
,
&
t
);
test
(
"15:32:23|0119-00-04"
,
"%ptTtr|%ptTdr"
,
&
t
,
&
t
);
test
(
"2019-01-04 15:32:23"
,
"%ptTs"
,
&
t
);
test
(
"0119-00-04 15:32:23"
,
"%ptTsr"
,
&
t
);
test
(
"15:32:23|2019-01-04"
,
"%ptTts|%ptTds"
,
&
t
,
&
t
);
test
(
"15:32:23|0119-00-04"
,
"%ptTtrs|%ptTdrs"
,
&
t
,
&
t
);
}
static
void
__init
...
...
lib/vsprintf.c
浏览文件 @
80ae5529
...
...
@@ -1798,7 +1798,8 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,
struct
printf_spec
spec
,
const
char
*
fmt
)
{
bool
have_t
=
true
,
have_d
=
true
;
bool
raw
=
false
;
bool
raw
=
false
,
iso8601_separator
=
true
;
bool
found
=
true
;
int
count
=
2
;
if
(
check_pointer
(
&
buf
,
end
,
tm
,
spec
))
...
...
@@ -1815,14 +1816,25 @@ char *rtc_str(char *buf, char *end, const struct rtc_time *tm,
break
;
}
raw
=
fmt
[
count
]
==
'r'
;
do
{
switch
(
fmt
[
count
++
])
{
case
'r'
:
raw
=
true
;
break
;
case
's'
:
iso8601_separator
=
false
;
break
;
default:
found
=
false
;
break
;
}
}
while
(
found
);
if
(
have_d
)
buf
=
date_str
(
buf
,
end
,
tm
,
raw
);
if
(
have_d
&&
have_t
)
{
/* Respect ISO 8601 */
if
(
buf
<
end
)
*
buf
=
'T
'
;
*
buf
=
iso8601_separator
?
'T'
:
'
'
;
buf
++
;
}
if
(
have_t
)
...
...
@@ -2261,7 +2273,7 @@ early_param("no_hash_pointers", no_hash_pointers_enable);
* - 'd[234]' For a dentry name (optionally 2-4 last components)
* - 'D[234]' Same as 'd' but for a struct file
* - 'g' For block_device name (gendisk + partition number)
* - 't[RT][dt][r]' For time and date as represented by:
* - 't[RT][dt][r]
[s]
' For time and date as represented by:
* R struct rtc_time
* T time64_t
* - 'C' For a clock, it prints the name (Common Clock Framework) or address
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录