Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
aaf680ea
Commit
aaf680ea
authored
Jul 02, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more places where we exported our internal time
to user space. Convert to standard clock_t.
parent
abd988c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
fs/proc/array.c
fs/proc/array.c
+6
-6
fs/proc/proc_misc.c
fs/proc/proc_misc.c
+11
-7
No files found.
fs/proc/array.c
View file @
aaf680ea
...
@@ -368,8 +368,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
...
@@ -368,8 +368,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
priority
,
priority
,
nice
,
nice
,
0UL
/* removed */
,
0UL
/* removed */
,
task
->
it_real_value
,
jiffies_to_clock_t
(
task
->
it_real_value
)
,
task
->
start_time
,
jiffies_to_clock_t
(
task
->
start_time
)
,
vsize
,
vsize
,
mm
?
mm
->
rss
:
0
,
/* you might want to shift this left 3 */
mm
?
mm
->
rss
:
0
,
/* you might want to shift this left 3 */
task
->
rlim
[
RLIMIT_RSS
].
rlim_cur
,
task
->
rlim
[
RLIMIT_RSS
].
rlim_cur
,
...
@@ -693,15 +693,15 @@ int proc_pid_cpu(struct task_struct *task, char * buffer)
...
@@ -693,15 +693,15 @@ int proc_pid_cpu(struct task_struct *task, char * buffer)
len
=
sprintf
(
buffer
,
len
=
sprintf
(
buffer
,
"cpu %lu %lu
\n
"
,
"cpu %lu %lu
\n
"
,
task
->
utime
,
jiffies_to_clock_t
(
task
->
utime
)
,
task
->
stime
);
jiffies_to_clock_t
(
task
->
stime
)
);
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
{
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
{
if
(
cpu_online
(
i
))
if
(
cpu_online
(
i
))
len
+=
sprintf
(
buffer
+
len
,
"cpu%d %lu %lu
\n
"
,
len
+=
sprintf
(
buffer
+
len
,
"cpu%d %lu %lu
\n
"
,
i
,
i
,
task
->
per_cpu_utime
[
i
]
,
jiffies_to_clock_t
(
task
->
per_cpu_utime
[
i
])
,
task
->
per_cpu_stime
[
i
]
);
jiffies_to_clock_t
(
task
->
per_cpu_stime
[
i
])
);
}
}
return
len
;
return
len
;
...
...
fs/proc/proc_misc.c
View file @
aaf680ea
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/smp_lock.h>
#include <linux/seq_file.h>
#include <linux/seq_file.h>
#include <linux/times.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/pgtable.h>
...
@@ -294,18 +295,21 @@ static int kstat_read_proc(char *page, char **start, off_t off,
...
@@ -294,18 +295,21 @@ static int kstat_read_proc(char *page, char **start, off_t off,
#endif
#endif
}
}
len
=
sprintf
(
page
,
"cpu %u %u %u %lu
\n
"
,
user
,
nice
,
system
,
len
=
sprintf
(
page
,
"cpu %u %u %u %lu
\n
"
,
jif
*
num_online_cpus
()
-
(
user
+
nice
+
system
));
jiffies_to_clock_t
(
user
),
jiffies_to_clock_t
(
nice
),
jiffies_to_clock_t
(
system
),
jiffies_to_clock_t
(
jif
*
num_online_cpus
()
-
(
user
+
nice
+
system
)));
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
){
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
){
if
(
!
cpu_online
(
i
))
continue
;
if
(
!
cpu_online
(
i
))
continue
;
len
+=
sprintf
(
page
+
len
,
"cpu%d %u %u %u %lu
\n
"
,
len
+=
sprintf
(
page
+
len
,
"cpu%d %u %u %u %lu
\n
"
,
i
,
i
,
kstat
.
per_cpu_user
[
i
]
,
jiffies_to_clock_t
(
kstat
.
per_cpu_user
[
i
])
,
kstat
.
per_cpu_nice
[
i
]
,
jiffies_to_clock_t
(
kstat
.
per_cpu_nice
[
i
])
,
kstat
.
per_cpu_system
[
i
]
,
jiffies_to_clock_t
(
kstat
.
per_cpu_system
[
i
])
,
jif
-
(
kstat
.
per_cpu_user
[
i
]
\
jif
fies_to_clock_t
(
jif
-
(
kstat
.
per_cpu_user
[
i
]
\
+
kstat
.
per_cpu_nice
[
i
]
\
+
kstat
.
per_cpu_nice
[
i
]
\
+
kstat
.
per_cpu_system
[
i
]));
+
kstat
.
per_cpu_system
[
i
]))
)
;
}
}
len
+=
sprintf
(
page
+
len
,
len
+=
sprintf
(
page
+
len
,
"page %u %u
\n
"
"page %u %u
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment