From patchwork Thu Nov 20 22:04:06 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Radford X-Patchwork-Id: 9908 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 8B75D47802 for ; Fri, 21 Nov 2008 10:26:21 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from mail.blackbean.org (cpe-67-49-92-118.socal.res.rr.com [67.49.92.118]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1A1FDDDE3 for ; Fri, 21 Nov 2008 09:13:23 +1100 (EST) Received: from home.blackbean.org (localhost.localdomain [127.0.0.1]) by mail.blackbean.org (8.14.2/8.14.2) with ESMTP id mAKM4BRh002377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Nov 2008 14:04:12 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=galvanix.net; s=apple; t=1227218653; bh=VtiSnSpn+rAt9UxG+KZFI+VJft3WHTv6VEo74D3zDRY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=sz42rOG1OcmTuUYDAbpa7UTc5/dm6lXhzIQMLO yZxeHRg24s8v3JUBPVhN0TXZR9PhQEAXQxfZ4ZumafmMnJyg52UyTf68O0dYfeHFxl3 5hhmhD7jj2dBdOd05JQq+Kg33Nd0CVsYG2SVEJTyANcdMDl8vdlXzFaCGE+5Q7actvo FDhXoDfmCRFLAfqWmfeWOUzsLEEdDspmGv9JbwmQ5WdokeCa/gBXTj4pfzyHLj3tOhm pPZfLD5LQgQ2VCOV1 Received: (from jim@localhost) by home.blackbean.org (8.14.2/8.14.2/Submit) id mAKM467J002374; Thu, 20 Nov 2008 14:04:06 -0800 Date: Thu, 20 Nov 2008 14:04:06 -0800 From: Jim Radford To: Steven Rostedt Subject: [PATCH] ftrace: mcountrecord.pl for arm Message-ID: <20081120220406.GA2159@blackbean.org> References: <20081120203415.251344054@goodmis.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20081120203415.251344054@goodmis.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on home.blackbean.org X-Mailman-Approved-At: Fri, 21 Nov 2008 10:25:32 +1100 Cc: Russell King - ARM Linux , Matt Fleming , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Paul Mundt , Ingo Molnar , Sam Ravnborg , Andrew Morton X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Ingo and Steven, Here is a patch on top of Steven's for recordmcount.pl on arm. -Jim --- From: Jim Radford Subject: ftrace: mcountrecord.pl for arm Signed-Off-By: Jim Radford diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index c5c58ac..3d16795 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -135,6 +135,7 @@ my $section_regex; # Find the start of a section my $function_regex; # Find the name of a function # (return offset and func name) my $mcount_regex; # Find the call site to mcount (return offset) +my $section_type; # Section header plus possible alignment command my $alignment; # The .align value to use for $mcount_section if ($arch eq "x86") { @@ -153,6 +154,7 @@ $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; $section_regex = "Disassembly of section\\s+(\\S+):"; $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; +$section_type = '@progbits'; $type = ".long"; if ($arch eq "x86_64") { @@ -191,6 +193,10 @@ if ($arch eq "x86_64") { $type = ".quad"; } +} elsif ($arch eq "arm") { + $alignment = 2; + $section_type = '%progbits'; + } else { die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; } @@ -311,7 +317,7 @@ sub update_funcs if (!$opened) { open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; $opened = 1; - print FILE "\t.section $mcount_section,\"a\",\@progbits\n"; + print FILE "\t.section $mcount_section,\"a\",$section_type\n"; print FILE "\t.align $alignment\n" if (defined($alignment)); } printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;