From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758542AbZLIWmW (ORCPT ); Wed, 9 Dec 2009 17:42:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758444AbZLIWmQ (ORCPT ); Wed, 9 Dec 2009 17:42:16 -0500 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:33070 "EHLO VA3EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758184AbZLIWmN (ORCPT ); Wed, 9 Dec 2009 17:42:13 -0500 X-SpamScore: -11 X-BigFish: VPS-11(zz154dM541I936eMab9bhzz1202hzzz2fh6bh61h) X-Spam-TCS-SCL: 0:0 Message-ID: <4B2027AA.6010703@am.sony.com> Date: Wed, 9 Dec 2009 14:41:46 -0800 From: Tim Bird User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: linux kernel CC: Steven Rostedt , Ingo Molnar , Frederic Weisbecker Subject: [PATCH 3/4] ftrace - add fdd script Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Dec 2009 22:41:47.0653 (UTC) FILETIME=[CA7C2B50:01CA7920] X-SEL-encryption-scan: scanned X-Reverse-DNS: mail8.fw-sd.sony.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add fdd (Function Duration Dump) program to scripts directory. The script should be 'chmod a+x'-ed. Signed-off-by: Tim Bird --- scripts/fdd | 766 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 766 insertions(+) --- /dev/null +++ b/scripts/fdd @@ -0,0 +1,766 @@ +#!/usr/bin/env python +# +# fdd (function duration dump): +# Read data from an ftrace duration dump, and format various ways. +# +# Based on kd (kft dump). +# +# Written by Tim Bird +# +# Copyright 2009 Sony Corporation of America +# +# GPL 2.0 applies +# +# ChangeLog: +# 0.7.2 - 2009/09/22 - add option to specify interrupt routine (int_func) +# adjust stack handling for int functions, add support for 'Ms time' +# 0.7.1 - 2009/09/17 - add --fields option +# 0.7.0 - 2009/07/28 - handle cpu, add filtering, and commmand line +# option for dump_list, fix func_stack management +# +# ToDo: +# + +MAJOR_VERSION = 0 +MINOR_VERSION = 7 +SUBMINOR_VERSION = 2 + +# define some constants +UNKNOWN = "-1" +PROGNAME_UNKNOWN = "unknown_progname" +PID_UNKNOWN = "-2" +TIME_UNKNOWN = "0.000000" + +import sys, os +import time +import re + +debug = 0 + +class stats_class: + def __init__(self): + self.missing_callers = 0 + self.total_functions = 0 + +def dprint(msg): + global debug + if debug: + print msg + +def usage(): + print """Usage: %s [] +This program parses the output from a set of function duration trace lines + +Options: + -d Show a list of functions, sorted by calltime and filtered + an expressions (if any). + -n Only show the most time-consuming functions. + -t