From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755452Ab0JUJDJ (ORCPT ); Thu, 21 Oct 2010 05:03:09 -0400 Received: from [120.204.251.227] ([120.204.251.227]:42060 "EHLO LC-SHMAIL-01.SHANGHAI.LEADCORETECH.COM" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755389Ab0JUJDH (ORCPT ); Thu, 21 Oct 2010 05:03:07 -0400 Subject: Re: Ftrace: can trace kthread? From: "Figo.zhang" To: Yong Zhang Cc: Li Zefan , "linux-kernel@vger.kernel.org" , Steven Rostedt In-Reply-To: References: <1287647732.2237.7.camel@myhost> <1287649283.2237.8.camel@myhost> <1287650668.2237.12.camel@myhost> Content-Type: text/plain; charset="UTF-8" Date: Thu, 21 Oct 2010 16:59:02 +0800 Message-ID: <1287651542.2237.17.camel@myhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Oct 2010 09:03:04.0720 (UTC) FILETIME=[C5787100:01CB70FE] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I just > echo 0 > tracing_enabled > echo function > current_tracer > echo 374(pid of flush) > set_ftrace_pid > echo 1 > tracing_enabled > wait some time > echo 0 > tracing_enabled > cat trace > > So I think this answer your question "could kthread be traced?" i do it the same of you. [root@myhost tracing]# ps -ax | grep flush Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html 1205 ? S 0:01 [flush-8:0] 11852 pts/1 S+ 0:00 grep flush [root@myhost tracing]# so my flusher pid is 1205, i do it as below: [root@myhost tracing]# echo 0 > tracing_enabled [root@myhost tracing]# echo function > current_tracer [root@myhost tracing]# echo 1205 > set_ftrace_pid [root@myhost tracing]# echo 1 > tracing_enabled wait ... and open some pdf files, let system eat huge memory... [root@myhost tracing]# echo 0 > tracing_enabled [root@myhost tracing]# cat trace # tracer: function # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | but i canot trace nothing.