Hi all:<br><br><div class="gmail_quote">2011/7/12 loody <span dir="ltr"><<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Dear all:<br clear="all"></div><div>Is there faster way to find a give name of task?</div><div>for example, I have a thread, named "test", is there faster way to get the task struct by passing "test" to some kernel api?</div>
<div><br></div><font color="#888888"><div><br></div>-- <br>Regards,<br>
</font></blockquote></div><div>I found a way as below:<br></div><div>for_each_process(task) { <br>printk(“%s[%d]\n”, task->comm, task->pid);<br></div><div>}<br clear="all"></div><div><br></div><div>But it is time-consuming to do so if I periodically want to know whether "test" exist or not.</div>
<div>is there better way to do so?</div><div><br></div><br>-- <br>Regards,<br>