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: <871tx8xp9s.fsf@sejong.aot.lge.com>
Date:	Tue, 08 Apr 2014 16:18:39 +0900
From:	Namhyung Kim <namhyung@...il.com>
To:	Don Zickus <dzickus@...hat.com>
Cc:	acme@...stprotocols.net, LKML <linux-kernel@...r.kernel.org>,
	jolsa@...hat.com, jmario@...hat.com, fowles@...each.com,
	peterz@...radead.org, eranian@...gle.com, andi.kleen@...el.com
Subject: Re: [PATCH 05/15 V3] perf, c2c: Rework setup code to prepare for features

On Mon, 24 Mar 2014 15:36:56 -0400, Don Zickus wrote:
> A basic patch that re-arranges some of the c2c code and adds a couple
> of small features to lay the ground work for the rest of the patch
> series.
>
> Changes include:
>
> o reworking the report path
> o replace preprocess_sample with simpler calls
> o rework raw output to handle separators
> o remove phys id gunk
> o add some generic options

[SNIP]
>
> +	return fprintf(fp, fmt,
> +		       tag,				sep,
> +		       reason ?: "valid record",	sep,
> +		       sample->pid,			sep,
> +		       sample->tid,			sep,
> +		       sample->cpu,			sep,
> +		       sample->ip,			sep,
> +		       sample->addr,			sep,
> +		       sample->weight,			sep,
> +		       sample->data_src,		sep,
> +		       data_src,			sep,
> +		       map ? (map->dso ? map->dso->long_name : "???") : "???",

How about using this instead?

		(map && map->dso) ? map->dso->long_name : "???".


> +		       mi->iaddr.sym ? mi->iaddr.sym->name : "???");
>  }
>  
>  static int perf_c2c__process_load_store(struct perf_c2c *c2c,
> +					struct addr_location *al,
>  					struct perf_sample *sample,
> -					struct addr_location *al)
> +					struct perf_evsel *evsel)
>  {
> -	if (c2c->raw_records)
> -		perf_sample__fprintf(sample, ' ', "raw input", al, stdout);
> +	struct mem_info *mi;
> +
> +	mi = sample__resolve_mem(sample, al);
> +	if (!mi)
> +		return -ENOMEM;
> +
> +	if (c2c->raw_records) {
> +		perf_sample__fprintf(sample, ' ', "raw input", mi, stdout);
> +		free(mi);
> +		return 0;
> +	}

It seems the 'mi' should be freed here as well?

>  
>  	return 0;
>  }


[SNIP]
> +static int perf_c2c__process_events(struct perf_session *session,
> +				    struct perf_c2c *c2c)
> +{
> +	int err = -1;

No need to set.

> +
> +	err = perf_session__process_events(session, &c2c->tool);
> +	if (err) {
> +		pr_err("Failed to process count events, error %d\n", err);
> +		goto err;

Unnecessary goto.

Thanks,
Namhyung


>  	}
>  
> +err:
>  	return err;
>  }
--
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