linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Cc: brueckner@linux.vnet.ibm.com, zvonko.kosic@de.ibm.com,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/2] perf record: wrong size in perf_record_mmap for last kernel module
Date: Fri, 4 Aug 2017 14:06:14 -0300	[thread overview]
Message-ID: <20170804170614.GP12201@kernel.org> (raw)
In-Reply-To: <7e74f3d2-204d-0067-4914-1dbba3f02db2@linux.vnet.ibm.com>

Em Thu, Aug 03, 2017 at 11:41:02AM +0200, Thomas-Mich Richter escreveu:
> On 08/02/2017 08:50 PM, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Jul 24, 2017 at 03:20:07PM -0300, Arnaldo Carvalho de Melo escreveu:
> >> Em Mon, Jul 24, 2017 at 04:35:14PM +0200, Thomas Richter escreveu:
> >>> +++ b/tools/perf/util/machine.c
> >>> @@ -20,6 +20,7 @@
> >>> +#include <sys/user.h>
> > 
> > no need for this header, see below.
> > 
> >>> -static int machine__create_module(void *arg, const char *name, u64 start)
> >>> +static int machine__create_module(void *arg, const char *name, u64 start, u64 size)
> >>>  {
> >>> @@ -1148,6 +1149,7 @@ static int machine__create_module(void *arg, const char *name, u64 start)
> >>>  	map = machine__findnew_module_map(machine, start, name);
> >>>  	if (map == NULL)
> >>>  		return -1;
> >>> +	map->end = roundup(start + size, PAGE_SIZE);
> > 
> > We have the page_size variable, that gets its value at:
> > 
> > tools/perf/perf.c:	page_size = sysconf(_SC_PAGE_SIZE);
> > 
> > always available, determined at run time.
> > 
> > Also, what is the reason for the roundup?
> > 
> 
> Ok I missed that page_size and will use it.
> The idea for the roundup to page size is the assumption that the kernel
> allocates full pages for memory to load modules. The size filed in the /proc/modules
> output refers to the module size in bytes.
> 
> If this is wrong we can omit the roundup.

Its not wrong, just looks unnecessary, a distraction, I'll remove it, ok?

- Arnaldo

 
> -- 
> Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
> --
> Vorsitzende des Aufsichtsrats: Martina Koederitz 
> Geschäftsführung: Dirk Wittkopp
> Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-08-04 17:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 14:35 [PATCH 1/2] perf report fix module symbol adjustment for s390x Thomas Richter
2017-07-24 14:35 ` [PATCH 2/2] perf record: wrong size in perf_record_mmap for last kernel module Thomas Richter
2017-07-24 18:20   ` Arnaldo Carvalho de Melo
2017-07-25  8:45     ` Thomas-Mich Richter
2017-08-02 18:50     ` Arnaldo Carvalho de Melo
2017-08-03  9:41       ` Thomas-Mich Richter
2017-08-04 17:06         ` Arnaldo Carvalho de Melo [this message]
2017-08-07  7:26           ` Thomas-Mich Richter
2017-08-07 16:05             ` Arnaldo Carvalho de Melo
2017-08-08  7:16               ` Thomas-Mich Richter
2017-07-25  6:58   ` Namhyung Kim
2017-07-25  8:26     ` Thomas-Mich Richter
2017-07-25  6:14 ` [PATCH 1/2] perf report fix module symbol adjustment for s390x Namhyung Kim
2017-07-25  8:49   ` Thomas-Mich Richter
2017-07-25 10:32     ` Namhyung Kim
2017-07-25 14:20       ` Arnaldo Carvalho de Melo
2017-08-02 11:25         ` Thomas-Mich Richter
2017-08-02 18:42 ` Arnaldo Carvalho de Melo
2017-08-03  9:37   ` Thomas-Mich Richter
2017-08-03 12:45     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170804170614.GP12201@kernel.org \
    --to=acme@kernel.org \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=tmricht@linux.vnet.ibm.com \
    --cc=zvonko.kosic@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).