From: Michael Ellerman <michael@ellerman.id.au>
To: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, andi@firstfloor.org,
ying.huang@intel.com, W.Li@Sun.COM, mingo@elte.hu,
heicars2@linux.vnet.ibm.com, mschwid2@linux.vnet.ibm.com
Subject: Re: [PATCH 3/4] gcov: add gcov profiling infrastructure
Date: Thu, 04 Jun 2009 02:01:03 +1000 [thread overview]
Message-ID: <1244044863.2998.10.camel@concordia> (raw)
In-Reply-To: <4A26961E.7040207@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
On Wed, 2009-06-03 at 17:26 +0200, Peter Oberparleiter wrote:
> Peter Oberparleiter wrote:
> > Andrew Morton wrote:
> >> On Tue, 02 Jun 2009 13:44:02 +0200
> >> Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:
> >>> + /* Duplicate gcov_info. */
> >>> + active = num_counter_active(info);
> >>> + dup = kzalloc(sizeof(struct gcov_info) +
> >>> + sizeof(struct gcov_ctr_info) * active, GFP_KERNEL);
> >>
> >> How large can this allocation be?
> >
> > Hm, good question. Having a look at my test system, I see coverage data
> > files of up to 60kb size. With counters making up the largest part of
> > those, I'd guess the allocation size can be around ~55kb. I assume that
> > makes it a candidate for vmalloc?
>
> A further run with debug output showed that the maximum size is
> actually around 4k, so in my opinion, there is no need to switch
> to vmalloc.
The real question is how big can active be, and it looks like <= 5 is
the answer:
+/* Determine number of active counters. Based on gcc magic. */
+static unsigned int num_counter_active(struct gcov_info *info)
+{
+ unsigned int i;
+ unsigned int result = 0;
+
+ for (i = 0; i < GCOV_COUNTERS; i++) {
+ if (counter_active(info, i))
+ result++;
+ }
+ return result;
+}
+#define GCOV_COUNTERS 5
So that seems reasonable.
I assumed these were the per BB counters, but it seems they're counter
_types_. Where are the BB counters, in the values array? If so perhaps
that is the candidate for vmalloc.
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-06-03 16:01 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-02 11:43 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-06-02 11:44 ` [PATCH 1/4] kernel: constructor support Peter Oberparleiter
2009-06-02 21:32 ` Andrew Morton
2009-06-03 11:55 ` Peter Oberparleiter
2009-06-02 11:44 ` [PATCH 2/4] seq_file: add function to write binary data Peter Oberparleiter
2009-06-02 11:44 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-06-02 22:03 ` Andrew Morton
2009-06-03 2:34 ` Michael Ellerman
2009-06-03 11:57 ` Peter Oberparleiter
2009-06-03 15:26 ` Peter Oberparleiter
2009-06-03 16:01 ` Michael Ellerman [this message]
2009-06-03 21:39 ` Andrew Morton
2009-06-04 8:26 ` Peter Oberparleiter
2009-06-04 8:40 ` Andrew Morton
2009-06-05 13:05 ` Peter Oberparleiter
2009-06-04 9:08 ` Amerigo Wang
2009-06-05 9:23 ` Peter Oberparleiter
2009-06-05 9:34 ` Andrew Morton
2009-06-05 10:12 ` Peter Oberparleiter
2009-06-06 8:30 ` Michael Ellerman
2009-06-08 8:24 ` Peter Oberparleiter
2009-06-05 9:55 ` Amerigo Wang
2009-06-02 11:44 ` [PATCH 4/4] gcov: enable GCOV_PROFILE_ALL for x86_64 Peter Oberparleiter
-- strict thread matches above, loose matches on Subject: below --
2009-05-19 14:24 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-19 14:24 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-19 15:00 ` Ingo Molnar
2009-05-22 8:55 ` Peter Oberparleiter
2009-05-22 9:22 ` Andi Kleen
2009-05-12 15:38 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-12 15:38 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-08 15:44 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-08 15:44 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-07 12:45 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-07 12:45 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-07 13:46 ` Ingo Molnar
2009-05-07 13:49 ` Ingo Molnar
2009-05-08 11:10 ` Peter Oberparleiter
2009-05-11 13:17 ` Ingo Molnar
2009-05-12 13:09 ` Peter Oberparleiter
2009-05-12 13:35 ` Ingo Molnar
2009-02-26 13:52 Peter Oberparleiter
2009-02-03 12:47 Peter Oberparleiter
2009-02-03 15:31 ` Ingo Molnar
2009-02-04 16:48 ` Peter Oberparleiter
2009-02-26 2:40 ` Li Wei
2009-02-26 10:00 ` Peter Oberparleiter
2009-02-26 10:33 ` Li Wei
2009-02-26 12:57 ` Peter Oberparleiter
2009-02-26 10:11 ` Li Wei
2009-02-26 11:46 ` Peter Oberparleiter
2009-02-26 12:08 ` Li Wei
2009-02-26 12:55 ` Peter Oberparleiter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244044863.2998.10.camel@concordia \
--to=michael@ellerman.id.au \
--cc=W.Li@Sun.COM \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=heicars2@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mschwid2@linux.vnet.ibm.com \
--cc=oberpar@linux.vnet.ibm.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox