Hi all:<br><br><div class="gmail_quote">2011/7/12 loody <span dir="ltr">&lt;<a href="mailto:miloody@gmail.com">miloody@gmail.com</a>&gt;</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 &quot;test&quot;, is there faster way to get the task struct  by passing &quot;test&quot; 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-&gt;comm, task-&gt;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 &quot;test&quot; exist or not.</div>
<div>is there better way to do so?</div><div><br></div><br>-- <br>Regards,<br>