Skip to contentSkip to conversation

export kernel call set_task_comm()

PATCH In review majianpeng 2 participants 5 messages May 31, 2012 – Jun 1, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 1/1 export kernel call set_task_comm()

In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly. Otherwise, a driver who is interested in this type of functionality has to implement their own get_task_comm() call, causing code duplication in the Linux source tree."

But author did not say about set_task_comm().At present,I used it but compiled error.To the same purpose, it should export.

---
 fs/exec.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/exec.c +1 -0
index 52c9e2f..2b0178b 100644
@@ -1072,6 +1072,7 @@ void set_task_comm(struct task_struct *tsk, char *buf)
 	task_unlock(tsk);
 	perf_event_comm(tsk);
 }
+EXPORT_SYMBOL_GPL(set_task_comm);
 
 static void filename_to_taskname(char *tcomm, const char *fn, unsigned int len)
 {
Signature · 6 lines
1.7.5.4

 				
--------------
majianpeng
2012-05-31
maintainer
#1 lore raw
Quoted 8 lines · majianpeng

In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly. Otherwise, a driver who is interested in this type of functionality has to implement their own get_task_comm() call, causing code duplication in the Linux source tree."

But author did not say about set_task_comm().At present,I used it but compiled error.To the same purpose, it should export.

Are you doing that to preexisting process? Or just to a kernel thread you are creating? In the latter case, you really ought to use kthread_create() instead of bare-metal kernel_thread()...

author
#2 lore raw
Quoted 7 lines · viro
Quoted 6 lines · majianpeng

In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly. Otherwise, a driver who is interested in this type of functionality has to implement their own get_task_comm() call, causing code duplication in the Linux source tree."

Quoted 6 lines
Quoted 2 lines

But author did not say about set_task_comm().At present,I used it but compiled error.To the same purpose, it should export.

Are you doing that to preexisting process? Or just to a kernel thread you are creating? In the latter case, you really ought to use kthread_create() instead of bare-metal kernel_thread()...

Yes, I am doing that to preexisting process and in module.So I think it should export.

------------------
majianpeng
2012-06-01

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#4 lore raw
Quoted 8 lines · majianpeng
Quoted 7 lines · viro
Quoted 6 lines · majianpeng

In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly. Otherwise, a driver who is interested in this type of functionality has to implement their own get_task_comm() call, causing code duplication in the Linux source tree."

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

But author did not say about set_task_comm().At present,I used it but compiled error.To the same purpose, it should export.

Are you doing that to preexisting process? Or just to a kernel thread you are creating? In the latter case, you really ought to use kthread_create() instead of bare-metal kernel_thread()...

Yes, I am doing that to preexisting process and in module.So I think it should export.

Why is that module playing with ->comm[] of process it hadn't spawned? Note that _reading_ ->comm[] has fairly mundane uses - debugging printks
and all such. Changing it, OTOH...

Details, please; "my module calls that, so it should be exported" is not enough.

author
#5 lore raw
Quoted 16 lines · viro
Quoted 15 lines · majianpeng
Quoted 13 lines · viro
Quoted 8 lines · majianpeng

In Commit 7d74f492e4dd0034a61458eb80f70b1d2862ed07,author said:
"This allows drivers who call this function to be compiled modularly. Otherwise, a driver who is interested in this type of functionality has to implement their own get_task_comm() call, causing code duplication in the Linux source tree."

But author did not say about set_task_comm().At present,I used it but compiled error.To the same purpose, it should export.

Are you doing that to preexisting process? Or just to a kernel thread you are creating? In the latter case, you really ought to use kthread_create() instead of bare-metal kernel_thread()...

Quoted 7 lines
Quoted 1 line

Yes, I am doing that to preexisting process and in module.So I think it should export.

Why is that module playing with ->comm[] of process it hadn't spawned? Note that _reading_ ->comm[] has fairly mundane uses - debugging printks
and all such. Changing it, OTOH...

Details, please; "my module calls that, so it should be exported" is not enough.

This module is md.
It created a thread with kthread_run.But the name is wrong because using some old information. Because it has mode places like this, so I thought to change the name at run-place . If so, I can modify the ->comm[] directly?

--------------
majianpeng