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]
Date:   Mon, 13 Jul 2020 17:27:53 +0100
From:   John Garry <john.garry@...wei.com>
To:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
CC:     lkml <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Michael Petlan <mpetlan@...hat.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Kajol Jain <kjain@...ux.ibm.com>,
        "Paul A. Clarke" <pc@...ibm.com>,
        Stephane Eranian <eranian@...gle.com>,
        Ian Rogers <irogers@...gle.com>
Subject: Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

On 12/07/2020 14:26, Jiri Olsa wrote:
>   
> +int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref)
> +{
> +	struct expr_id_data *data_ptr = NULL, *old_data = NULL;
> +	char *old_key = NULL;
> +	char *name;
> +	int ret;
> +
> +	data_ptr = zalloc(sizeof(*data_ptr));
> +	if (!data_ptr)
> +		return -ENOMEM;
> +
> +	name = strdup(ref->metric_name);
> +	if (!name) {
> +		free(data_ptr);
> +		return -ENOMEM;
> +	}

JFYI, this was not compiling for me:

util/expr.c: In function ‘expr__add_ref’:
util/expr.c:84:13: error: implicit declaration of function ‘zalloc’; did 
you mean ‘valloc’? [-Werror=implicit-function-declaration]
  data_ptr = zalloc(sizeof(*data_ptr));
  ^~~~~~
  valloc
util/expr.c:84:13: error: nested extern declaration of ‘zalloc’ 
[-Werror=nested-externs]
util/expr.c:84:11: error: assignment to ‘struct expr_id_data *’ from 
‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
  data_ptr = zalloc(sizeof(*data_ptr));
^
  LDutil/arm-spe-decoder/perf-in.o
cc1: all warnings being treated as errors

I think the zalloc.h include is missing.

Thanks,
john

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ