Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp503030rdb; Thu, 5 Oct 2023 12:07:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPlFTi4W0DeDyu3dPxvebue++B4ArgSgw/kQC3HVPrBh2TnTN+ADnvtxljSUiFCAWzreHd X-Received: by 2002:a05:6358:63a1:b0:134:e631:fd2b with SMTP id k33-20020a05635863a100b00134e631fd2bmr6951834rwh.0.1696532823287; Thu, 05 Oct 2023 12:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696532823; cv=none; d=google.com; s=arc-20160816; b=Yd93Hp2WgZU9jffzbXsEqAnfSe/33eVNbD4rwgS6PItFa2PxwXXxh/e6SDUyjWAkBC c60wNYrcvdUvFS+cOVDT393bHxeENB9ZAVAXGbXgfcIBpCCTBL0cUofUk4UkifA4SwW3 If7hYXuCSqYDsjb6YfEp/ZI1beVOkdtYpBvMlE0zUZWUAhznjGwo41AiP1jcWJKh8twJ Nc8Asn5Daz75U3xJWGcRdvBB4FYViZuW3fcMGFvvry+vLZ+yFJTPOx1d5bN3o1MUl8+Q 4B5ApQkLv32DxkW7zop8tOjvUTFNYsQxzILiKl8jeuKq4bT48czX673v8qxyyWV514Lf SV0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ut+nxo9NjF94t/TI85ATgeBEyyQJZ6rdWiZsRhWBkvE=; fh=7ueK1huCq2Lf3LMjc8i3Ob70zhQl+8ZRdqYzG6swRYY=; b=AFNWMqwsKMt6AXlYh4mSP9q7cDw5doFPwFoyQePVNLs+Kh4xAjpzdtqLTQDPidGYhy mvU3gtW/iAwifJMr5NGnSK+wnbdUpT+nC1Wbi3ay+zFZ0Jjnx33mbo3SOJSVcapro5Hp QuXCni7Oj6lfj9gapoEQm0mRjS8AdeKxs+fXBjNnNrIMHyQcQPjs+817GhZ5+5w4DNmk w1QS9lBqjzi2lAH3alzk5jNgXHzSBdKIduBNUsC8xvwTf5MBgwYTfJN5TmoUtRVSEiFc HW4Ig3LFXHJJjPiyQ44v5EfST7ZOo0vEp+kf0Uq47+HA327HC6nQh/rTE4MCd0u7jo62 yNBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GYLfpluD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x34-20020a634a22000000b005694492c259si1935654pga.282.2023.10.05.12.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 12:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GYLfpluD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4ED20835C237; Thu, 5 Oct 2023 12:06:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbjJETGw (ORCPT + 99 others); Thu, 5 Oct 2023 15:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbjJETGn (ORCPT ); Thu, 5 Oct 2023 15:06:43 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E54BD9; Thu, 5 Oct 2023 12:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696532797; x=1728068797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Idg8ltgyFZaayjhZqPMjxwfK9UI2JApxxyIZyfMjKUk=; b=GYLfpluDeVMuZW+WyB0/L2uLMqRzIBuF1ZFpTVxE5tkVQOeL+7p0Np0c AevmLnwWksu0eQkMUfHZDwnfsPBCJs4bTCe9SPOqpo1jlPjHt0erl98dH msyDgRGdnVT3UwLXDhvcly8JjJ9ZR+vaADaIcvl5EdH4XC0Y6V+9KxAiP z4Zh9KHKQkjj7X8gMijCDzw8jAC8Rn5ubP50bnhRFuHbAsdek89CB68Fs CQHR9tpb6KtgH54+Q0PyevGUVFLiCRGxZ1eLYS/1olVRoVI1kaFNM26f2 ZqvqxjEwA7M+lITBSgY96S3d53Ppl0fIpo9nUV0/2aJgAjW4ppHwgaAnx A==; X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="383488268" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="383488268" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 12:05:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10854"; a="999055209" X-IronPort-AV: E=Sophos;i="6.03,203,1694761200"; d="scan'208";a="999055209" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.249.35.8]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2023 12:05:18 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH 5/5] perf intel-pt: Prefer get_unaligned_le64 to memcpy_le64 Date: Thu, 5 Oct 2023 22:04:51 +0300 Message-Id: <20231005190451.175568-6-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231005190451.175568-1-adrian.hunter@intel.com> References: <20231005190451.175568-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 12:06:59 -0700 (PDT) Use get_unaligned_le64() instead of memcpy_le64(..., 8) because it produces simpler code. Signed-off-by: Adrian Hunter --- tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c index 7a90218aecb1..bccb988a7a44 100644 --- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c @@ -190,7 +190,7 @@ static int intel_pt_get_mnt(const unsigned char *buf, size_t len, if (len < 11) return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_MNT; - memcpy_le64(&packet->payload, buf + 3, 8); + packet->payload = get_unaligned_le64(buf + 3); return 11; } @@ -302,7 +302,7 @@ static int intel_pt_get_bip_8(const unsigned char *buf, size_t len, return INTEL_PT_NEED_MORE_BYTES; packet->type = INTEL_PT_BIP; packet->count = buf[0] >> 3; - memcpy_le64(&packet->payload, buf + 1, 8); + packet->payload = get_unaligned_le64(buf + 1); return 9; } @@ -341,7 +341,7 @@ static int intel_pt_get_evd(const unsigned char *buf, size_t len, packet->type = INTEL_PT_EVD; packet->count = buf[2] & 0x3f; packet->payload = buf[3]; - memcpy_le64(&packet->payload, buf + 3, 8); + packet->payload = get_unaligned_le64(buf + 3); return 11; } -- 2.34.1