[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANudz+vxY_0NY2veJ9Wvr08x_z3e20m=g7ZL4bZDi=-vaOF7dQ@mail.gmail.com>
Date: Tue, 12 Jul 2011 00:52:30 +0800
From: loody <miloody@...il.com>
To: linux-kernel@...r.kernel.org
Subject: how to find a task through name faster?
hi all:
I found a way to find a task I need by name, test, as below:
for_each_process(task) {
if(strcmp(task->comm, "test")
printk(“%s[%d]\n”, task->comm, task->pid);
}
But it is time-consuming to do so if I periodically want to know
whether "test" exist or not.
is there better way to do so?
--
Regards,
--
Regards,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists