Received: by 10.213.65.68 with SMTP id h4csp2118545imn; Sun, 8 Apr 2018 20:09:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/UBGWrs7gxLh6TeFo/FY7RWh0OwBYsCHmzZJw61TmSk5OzRYsnnG3/Pym+kxrd3Y/ZYKKl X-Received: by 2002:a17:902:b58a:: with SMTP id a10-v6mr10964112pls.249.1523243394523; Sun, 08 Apr 2018 20:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243394; cv=none; d=google.com; s=arc-20160816; b=szsoMpt6GIavUBVdbEAAyGi2vpbUIYaj35sPDzsWoxO58Kdj4PK5wAabCWKLiqz+B+ s/NgkY/h4xU+J6yoummzxyKCMkwyOXJcLU32KnDnYoxsQ1sYCFc3G4m/0Sfn+b6jscGm I+Q1xife3K2ckX951wAOlMdxZCa+kQ6PTD7fFh3sRkjQ00WZ4M20IFKo6LQ5YbCg9kiv FINcBIksqjltjF9lcCQsjeh0xJw0LfYXUScDTAeEE2GKguoyaLFIYkXL7+L+zVhbz52k Cz0r1QTV69HJEG2xsgtoAKAwPFHb8sxKv2NO/t7ok5FEJyUMUCdvJKvMZKdm6Zr/kGkk zQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=OGsH4OJyel/0Qcgq1ndKzEqqd4pOIB7VKN3SKtIR6+Y=; b=dp8oFWylciVJ3YLGmD3n6Cex04vNDiC23EPOYovicC6JOcIHlRiGIMXBbeUdxVDYd6 /gc2gBEjIA4d4Td7k0r9RwAp3JslmLRqs1CALIJluV1/aXpxnBOJWnzrqltbVMVeNTb2 GJhwn9VQd3b8yT7KvuP1oktKV54yNln+sQodSQ+54ju7wy38s5jZCP07wyZNPZK8U6Xv C8zeOyfKE7tEvGL3mHhGvc+hoUNF8mNOmWy4TNCxeoZMQtN8SwsR9IWfSv767KLGd1Hs zhOpnWzYzuVvDmQT/CpJ6IdolrzviyDwZguui+SbvYCGIUm2tYU7Q4XXsW7rMz7vkXyr XGzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e+2cawtL; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si8766262pgp.666.2018.04.08.20.09.17; Sun, 08 Apr 2018 20:09:54 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e+2cawtL; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756028AbeDICqB (ORCPT + 99 others); Sun, 8 Apr 2018 22:46:01 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:2432 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755414AbeDIA0m (ORCPT ); Sun, 8 Apr 2018 20:26:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OGsH4OJyel/0Qcgq1ndKzEqqd4pOIB7VKN3SKtIR6+Y=; b=e+2cawtLvVPFuSbazbSLH/sUhGnGryHa7CcWTBPbG4GB1ikSbSQCM0fKur6QlrY+I/pzPFvyU/LStSDYNve0K2tY8dPwjqC0D+k62VHNnkaOIkNPdUHy28mOzgw9sxLLd5raGSse0cxQ5Wpvr7nctLry3y2puzM453rILaRNgBk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:26:38 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:26:38 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Namhyung Kim , Adrian Hunter , David Ahern , Peter Zijlstra , Wang Nan , "kernel-team@lge.com" , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 015/293] perf tools: Decompress kernel module when reading DSO data Thread-Topic: [PATCH AUTOSEL for 4.9 015/293] perf tools: Decompress kernel module when reading DSO data Thread-Index: AQHTz5jqrDr4YpTazEmk1BBVUFbDGw== Date: Mon, 9 Apr 2018 00:23:00 +0000 Message-ID: <20180409002239.163177-15-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0885;7:SON1Xv1UdNkuTbm2ZamhXrNSTi5wGPH4tGrqKgqDwe/2Ow/tLr+Vyq4VNE58rktVY1RcFpm3K68TpjgpzmkmLIgnjtC6Y9zj+Y8/PlfaYC2QEAZPYNwBrRHbahWSaH5C89Mr77FjKUNOb8DkHQKEqBTP7z7w/8mr3Apzzq76KxfMi9APguIwO5I2SQJ3tTZUTctXpkGL/cpp+illjV1ov/FmSmW99epCMcQu48sOLrrFtOfhUUYTN66DFLUkUAMy;20:3wef03saLhzwfciODIIodphtNZ5V6KJGMAlZ20gPVrXWMG1J4bkBuRacO1DH+JcpOycGNGZN03ngFBZKp4YXq2KPz+60SAa+VD4TKZ8uxG6AVbBo29zaDRkbegcf6c/GKQTRVVdf9/Hc98WBIHiRNetEfefOtZJGBjRny8UAxkM= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 1293857a-6d24-4516-32bb-08d59db08f69 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513)(85827821059158)(42068640409301)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(39380400002)(189003)(199004)(2906002)(68736007)(22452003)(316002)(6512007)(5660300001)(6666003)(54906003)(110136005)(486006)(6486002)(102836004)(6306002)(36756003)(14454004)(99286004)(86612001)(105586002)(72206003)(106356001)(2900100001)(1076002)(97736004)(10090500001)(3280700002)(5250100002)(6436002)(3660700001)(6116002)(3846002)(305945005)(86362001)(66066001)(39060400002)(10290500003)(186003)(81166006)(8936002)(478600001)(476003)(25786009)(81156014)(8676002)(4326008)(7736002)(2501003)(107886003)(966005)(6506007)(2616005)(26005)(76176011)(446003)(53936002)(11346002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: /6ZwMVFU5KiO9AcpyE+3z9h9vfQx5iDwIqZEpKwDWRhNIQHOf0h3ekd8DBQOR6NPkOnHMKYsQ+Oh5+6SqL6rwfz1BOgo/lJB0shbyPOqtRnA9CKxGmrdrNJYIQ5nLm8ZGAKCG8WDywusI+/BN6op9/MANxxLfkNCmhBZ5UyZ+Z56PyyK0YgYQcxKFVjHe2JRL+i4pprEvTqn9/GmFlDK9jZyip/aIOoO9Rlussliyl7aPr2weSLpFoU5SFWy+e6DujPRMifwLrliyTHptdrjJfT59bqIU8snUbuHMFSCl2bQwcOzstfkWKiR9/C5DvOLKd6vfTVkFRaIHB8GzCnCI7nT665la8GgyIXUkDfSW9mo91hJcXFJCE3cIQiBj71V+qHte4+EzzFXtH4ajJSSx+thmpkkL2OO/t0SZeNQkDQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1293857a-6d24-4516-32bb-08d59db08f69 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:00.3154 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namhyung Kim [ Upstream commit 1d6b3c9ba756a5134fd7ad1959acac776d17404b ] Currently perf decompresses kernel modules when loading the symbol table but it missed to do it when reading raw data. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: David Ahern Cc: Peter Zijlstra Cc: Wang Nan Cc: kernel-team@lge.com Link: http://lkml.kernel.org/r/20170608073109.30699-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/dso.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index d2c6cdd9d42b..4bc58822416c 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -366,7 +366,23 @@ static int __open_dso(struct dso *dso, struct machine = *machine) if (!is_regular_file(name)) return -EINVAL; =20 + if (dso__needs_decompress(dso)) { + char newpath[KMOD_DECOMP_LEN]; + size_t len =3D sizeof(newpath); + + if (dso__decompress_kmodule_path(dso, name, newpath, len) < 0) { + free(name); + return -dso->load_errno; + } + + strcpy(name, newpath); + } + fd =3D do_open(name); + + if (dso__needs_decompress(dso)) + unlink(name); + free(name); return fd; } --=20 2.15.1