From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751308AbdFALaA (ORCPT ); Thu, 1 Jun 2017 07:30:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162AbdFAL3r (ORCPT ); Thu, 1 Jun 2017 07:29:47 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 12FBF8048C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 12FBF8048C Date: Thu, 1 Jun 2017 13:29:38 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , kernel-team@lge.com, David Ahern , Adrian Hunter Subject: Re: [PATCH 1/2] perf tools: Decompress kernel module when reading DSO data Message-ID: <20170601112937.GB15888@krava> References: <20170601090605.5809-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170601090605.5809-1-namhyung@kernel.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 01 Jun 2017 11:29:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 01, 2017 at 06:06:04PM +0900, Namhyung Kim wrote: SNIP > - } > - > - unlink(tmpbuf); > - > -out: > - free(m.ext); > - return fd; > -} > - > bool symsrc__possibly_runtime(struct symsrc *ss) > { > return ss->dynsym || ss->opdsec; > @@ -702,9 +668,13 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, > int fd; > > if (dso__needs_decompress(dso)) { > - fd = decompress_kmodule(dso, name, type); > + char buf[32]; > + > + fd = dso__decompress_kmodule(dso, name, buf, sizeof(buf)); > if (fd < 0) > return -1; > + > + unlink(buf); I wonder we could make this more clear and add: dso__decompress_kmodule_fd dso__decompress_kmodule_path _fd version would remove the file and _path version would close the descriptor in any case, could you please split the change so the changes to decompress_kmodule are apparent? thanks, jirka