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: <20130109165539.GB1045@krava.brq.redhat.com>
Date:	Wed, 9 Jan 2013 17:55:39 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...e.hu,
	ak@...ux.intel.com, acme@...hat.com, namhyung.kim@....com
Subject: Re: [PATCH v5 11/18] perf tools: add mem access sampling core support

On Mon, Jan 07, 2013 at 07:27:50PM +0100, Stephane Eranian wrote:

SNIP

>  
> +static void ip__resolve_data(struct machine *self, struct thread *thread,
> +			     u8 m,
> +			    struct addr_map_symbol *ams,
> +			    u64 addr)
> +{
> +	struct addr_location al;
> +
> +	memset(&al, 0, sizeof(al));
> +
> +	thread__find_addr_location(thread, self, m, MAP__VARIABLE, addr, &al,
> +				   NULL);
> +	ams->addr = addr;
> +	ams->al_addr = al.addr;
> +	ams->sym = al.sym;
> +	ams->map = al.map;
> +}
> +
> +struct mem_info *machine__resolve_mem(struct machine *self,
> +				      struct thread *thr,
> +				      struct perf_sample *sample,
> +				      u8 cpumode)
> +{
> +	struct mem_info *mi;
> +
> +	mi = calloc(1, sizeof(struct mem_info));
> +	if (!mi)
> +		return NULL;
> +
> +	ip__resolve_ams(self, thr, &mi->iaddr, sample->ip);
> +	ip__resolve_data(self, thr, cpumode, &mi->daddr, sample->addr);
> +	mi->cost = sample->weight;
> +	mi->dsrc.val = sample->dsrc;
> +
> +	return mi;
> +}
> +

The crash I report is due to the some maps could be removed
via map_groups__fixup_overlappings.

Attached patch makes the code working for me, but we might
want to have some global unified fix for that, since this
is not the only place suffering for that.

Like globaly set map->referenced in add_hist_entry or
hist_entry__new functions..


jirka
---
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 49ca66b..615aecf 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -266,11 +266,15 @@ static void ip__resolve_ams(struct machine *self, struct thread *thread,
 		if (al.sym)
 			goto found;
 	}
+
 found:
 	ams->addr = ip;
 	ams->al_addr = al.addr;
 	ams->sym = al.sym;
 	ams->map = al.map;
+
+	if (ams->map)
+		ams->map->referenced = true;
 }
 
 static void ip__resolve_data(struct machine *self, struct thread *thread,
@@ -288,6 +292,9 @@ static void ip__resolve_data(struct machine *self, struct thread *thread,
 	ams->al_addr = al.addr;
 	ams->sym = al.sym;
 	ams->map = al.map;
+
+	if (ams->map)
+		ams->map->referenced = true;
 }
 
 struct mem_info *machine__resolve_mem(struct machine *self,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ