lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1244044863.2998.10.camel@concordia>
Date:	Thu, 04 Jun 2009 02:01:03 +1000
From:	Michael Ellerman <michael@...erman.id.au>
To:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, andi@...stfloor.org,
	ying.huang@...el.com, W.Li@....COM, mingo@...e.hu,
	heicars2@...ux.vnet.ibm.com, mschwid2@...ux.vnet.ibm.com
Subject: Re: [PATCH 3/4] gcov: add gcov profiling infrastructure

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@...ux.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

Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ