Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2186566ybl; Thu, 15 Aug 2019 07:53:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJJzJD/yUNmmJgHKtd96QTY3N3vSSr6RubW+/PZ4bVXTEjiGTDLAz0aIytHZyd2dJ6em8i X-Received: by 2002:a17:902:86:: with SMTP id a6mr4732044pla.244.1565880832184; Thu, 15 Aug 2019 07:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565880832; cv=none; d=google.com; s=arc-20160816; b=u86ma9ZsuGQOopDbXeH9pbAzQZ545jwZ9ukJqWzfmdcfvOzO0WoGPQxfcHzAyAv6IT VKRGhbcimo3hAco+2IBcpTIryhni4w3ABMM236Hiz3tbcN0q9eV5o/pubOW+075yyzf/ 2rWKfhXelLu2PoqCz25mlc3HZxbEHXiaV+zI2QaVaEE9GsrkhMHNfZnTPij/CaBYRyEf g1Zn4UF7w8bYWMnG3E1oi/9vxwwfPmsyI4jAhiL1Cy2WVnRGhQZmJiCRPXc57K8R7Y8b 7rlytE4gMtkN01o1pnm+OpcwFMgTohDtj6UYTgocKL3sVW3bLx53AVDfZu2vadgOoqg2 xZYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lpYqWrlZROv19eMRSarH4kkJugcqQxWwNnqy0Lku7GI=; b=vKTU9SMvsaiut01JzvKr5iNgbxrumKJapkpqV6XRHLj4VHzf9b/tdjEkHhKZdXL1Fi 5brYV9Tu7iZOF/Uy7WP2MADJz9XNvA4KqGAs0Q0cetw0Thnya/Y6PKC8ReFD8SJ0zyT5 NjDcKY6k1lqFrHeCKoZ//e4epWYYdlwFv1/Q/sj8WQLbbtTDmVQ4Pkr/q5MY52lYPXL2 Z747NB1X34kCGzA1UbCwZ5TKZd2bRUlxMLrODhZdY98YBWu+0a6BwIprAF2ipWor7wTy X5pmBWEK7mmTb35eV6I+F6bZY+dYOF2vTSryBJp8l0CbNQxSCMfkibE2+wkw/DsTWO/h Su6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si1950312pgs.322.2019.08.15.07.53.36; Thu, 15 Aug 2019 07:53:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731924AbfHOMvU (ORCPT + 99 others); Thu, 15 Aug 2019 08:51:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41486 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731645AbfHOMvU (ORCPT ); Thu, 15 Aug 2019 08:51:20 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7E06C057EC6; Thu, 15 Aug 2019 12:51:19 +0000 (UTC) Received: from krava (unknown [10.43.17.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0557A5D6A9; Thu, 15 Aug 2019 12:51:16 +0000 (UTC) Date: Thu, 15 Aug 2019 14:51:16 +0200 From: Jiri Olsa To: Mamatha Inamdar Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, jeremie.galarneau@efficios.com, shawn@git.icu, tstoyanov@vmware.com, tglx@linutronix.de, alexey.budankov@linux.intel.com, adrian.hunter@intel.com, songliubraving@fb.com, ravi.bangoria@linux.ibm.com Subject: Re: [PATCH]Perf: Return error code for perf_session__new function on failure Message-ID: <20190815125116.GG30356@krava> References: <20190814092654.7781.81601.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190814092654.7781.81601.stgit@localhost.localdomain> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 15 Aug 2019 12:51:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 03:02:18PM +0530, Mamatha Inamdar wrote: SNIP > symbol_conf.pid_list_str = strdup(trace->opts.target.pid); > diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c > index ddbcd59..dbc6dc2 100644 > --- a/tools/perf/util/data-convert-bt.c > +++ b/tools/perf/util/data-convert-bt.c > @@ -1619,8 +1619,10 @@ int bt_convert__perf2ctf(const char *input, const char *path, > err = -1; > /* perf.data session */ > session = perf_session__new(&data, 0, &c.tool); > - if (!session) > + if (IS_ERR(session)) { > + err = PTR_ERR(session); > goto free_writer; > + } > > if (c.queue_size) { > ordered_events__set_alloc_size(&session->ordered_events, I'm getting: CC util/data-convert-bt.o util/data-convert-bt.c: In function ‘bt_convert__perf2ctf’: util/data-convert-bt.c:1622:6: error: implicit declaration of function ‘IS_ERR’; did you mean ‘SIG_ERR’? [-Werror=implicit-function-declaration] 1622 | if (IS_ERR(session)) { | ^~~~~~ | SIG_ERR util/data-convert-bt.c:1622:6: error: nested extern declaration of ‘IS_ERR’ [-Werror=nested-externs] util/data-convert-bt.c:1623:9: error: implicit declaration of function ‘PTR_ERR’ [-Werror=implicit-function-declaration] 1623 | err = PTR_ERR(session); jirka