Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp763335ybm; Wed, 22 May 2019 11:05:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeyBdmp4cnX3ur780+JlUZSIKABiONweGLLr9ztukN42tHYEVviMLcF05dVKpvrPp4mN+Z X-Received: by 2002:a65:614a:: with SMTP id o10mr74693656pgv.258.1558548311470; Wed, 22 May 2019 11:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558548311; cv=none; d=google.com; s=arc-20160816; b=n9FanCNj9kA7Er9AfpMbQXGkUQqodakXZn63tJEXRg9wYj//LbORGqF6pxCRMy37kA 4rJlWJvUTZGlnFMZ6zfWhRlyPQPXt2Bjcth7gKEPeVSQKX0/5jafncwkW7rLgkFA+ugc LlfaxAO9/MrcTxUSswaeJ34CbwHC8dcL3YBYS1hEXFSIY2N3khv+iPvnJK4AFbCFtv8q s5Jwle0wmZo/M2xVau41vUtNBKPNOIM7RzNpTtGppwxdoQ4NE+vQAeW+ph7NvDp1vGS/ wuzukDEeJiCiSOXYjZgN7buroH7KeFwdcDG++/cEJIJ0YO4xlh6J5s3lDH+4iFi5vvRO UTxQ== 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-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=oxyDsoTHFUzofkcraRdmEa5q+RjpkJbCd1vJwf92rGQ=; b=UmziVlMj2Z5m95zZA3AzU3WKalTbl70FZEtsdQH3hw+7mAGB9mYMjSO5YDIXLpQoLO 1LvuVSWsJmw900U7aPo68CcALcdXaK7FUXSDBxAwGytrnGOFP7oZPPmI2FkvPP0cVUFu IpKMZl/2R3TeQ503mbSXsNnreFD9kfN+EQ77D/gM/UU+RPzw85z8vVMPWrC3q11FSiKQ DHO8TRGrtWwCQ9ClQ5+aB5wFCLX5qL20JTl0conGloYqYJ0QT7DsPePJvDwbFqawp1u/ hy4YfJqo5TDWidCqccTtZx8Ac72cV2hWj5cKNi1cIm/CFRtqRhw0nLiupu55YgWzy2t3 1haw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hqi2qu9Q; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si25921513pgr.413.2019.05.22.11.04.55; Wed, 22 May 2019 11:05:11 -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=@gmail.com header.s=20161025 header.b=hqi2qu9Q; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729155AbfEVSDf (ORCPT + 99 others); Wed, 22 May 2019 14:03:35 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37317 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727975AbfEVSDf (ORCPT ); Wed, 22 May 2019 14:03:35 -0400 Received: by mail-qt1-f194.google.com with SMTP id o7so3497814qtp.4; Wed, 22 May 2019 11:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oxyDsoTHFUzofkcraRdmEa5q+RjpkJbCd1vJwf92rGQ=; b=hqi2qu9QuXcX8/7V3QmgW7Ddts/lKukQqbObrp8ahI2bPQFCru6WclVLN2cck931VQ Enw9nQID45IP6osK62fuKtfDgzjBCg2eOWGwSrDPNMMbrJMOw5EcP/FRUGoWD8gEnzoS 68Fpv6wxlb/j0A/iNej3TRSXbsxSKVK73gBjqCN3r/RUWXz/JuoWYrNaSykr2tSpmZJA PWFNjj98Sfky7rBiILhy6Ks8XXX0BPJ5PkDBh8y8kvk9s486JkvzZBXoNkLF71LpNcuf 7BkSsMkGmrC1nZTC1NTEz4kJnhXc8FQUEi6zBeflW+iFoQaov/7axzjOisgBv13ckd88 vT5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oxyDsoTHFUzofkcraRdmEa5q+RjpkJbCd1vJwf92rGQ=; b=qDa9rarlsCU/RIVsJgUTQJffFS5qFz9I+2omZZYGZMet75pjonNgO7elClgXdaijdg ZFugzS6bW6QXDVTFW4HMt7aEHTjHh8mKSdO7wbgHIhHJ6iGKi1sTjRKwEIPTtpjbQRba 9xkZkwmJQ2AgjJTOlXbMSr7EN1IbbaUi+uPD/M3aurDWEOHSYcAJoA7MXHKnEXhoREZ/ 3NDjr0n9rm3rHfEaanWcZb628Zn9LwHsw60tM4qMtyW+CWKfPQ1dL3ZwTn2HaKg3xJAM jFlM4cM0oOmwIxi1yubGqFUDQnFgyp0gF52Xlnb9jdntTQZt5LH2VvWCRSzaeEsSCSy5 kdUQ== X-Gm-Message-State: APjAAAUFjDpe049TJuO0lyOOZMmXsLPFZk2zOYVmqVKeA7uVLIl+uAD4 GspKmijvcjMRYwsoka4QhaU= X-Received: by 2002:ac8:2732:: with SMTP id g47mr43323757qtg.156.1558548213971; Wed, 22 May 2019 11:03:33 -0700 (PDT) Received: from quaco.ghostprotocols.net ([190.15.121.82]) by smtp.gmail.com with ESMTPSA id o6sm12362521qtc.47.2019.05.22.11.03.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 22 May 2019 11:03:32 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 8B3B8404A1; Wed, 22 May 2019 15:03:27 -0300 (-03) Date: Wed, 22 May 2019 15:03:27 -0300 To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, brueckner@linux.vnet.ibm.com, heiko.carstens@de.ibm.com Subject: Re: [PATCH 3/3] perf record: Fix s390 missing module symbol and warning for non-root users Message-ID: <20190522180327.GH30271@kernel.org> References: <20190522144601.50763-1-tmricht@linux.ibm.com> <20190522144601.50763-4-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522144601.50763-4-tmricht@linux.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, May 22, 2019 at 04:46:01PM +0200, Thomas Richter escreveu: > Command 'perf record' and 'perf report' on a system without kernel > debuginfo packages uses /proc/kallsyms and /proc/modules to find > addresses for kernel and module symbols. On x86 this works for root > and non-root users. > > On s390, when invoked as non-root user, many of the following warnings > are shown and module symbols are missing: > > proc/{kallsyms,modules} inconsistency while looking for > "[sha1_s390]" module! > > Command 'perf record' creates a list of module start addresses by > parsing the output of /proc/modules and creates a PERF_RECORD_MMAP > record for the kernel and each module. The following function call > sequence is executed: > > machine__create_kernel_maps > machine__create_module > modules__parse > machine__create_module --> for each line in /proc/modules > arch__fix_module_text_start > > Function arch__fix_module_text_start() is s390 specific. It opens > file /sys/module//sections/.text to extract the module's .text > section start address. On s390 the module loader prepends a header > before the first section, whereas on x86 the module's text section > address is identical the the module's load address. > > However module section files are root readable only. For non-root the > read operation fails and machine__create_module() returns an error. > Command perf record does not generate any PERF_RECORD_MMAP record > for loaded modules. Later command perf report complains about missing > module maps. > > To fix this function arch__fix_module_text_start() always returns > success. For root users there is no change, for non-root users > the module's load address is used as module's text start address > (the prepended header then counts as part of the text section). Thanks, applied. - Arnaldo