|
@@ -233,7 +233,8 @@ void __map_groups__fixup_end(struct map_groups *mg, enum map_type type)
|
|
|
goto out_unlock;
|
|
|
|
|
|
for (next = map__next(curr); next; next = map__next(curr)) {
|
|
|
- curr->end = next->start;
|
|
|
+ if (!curr->end)
|
|
|
+ curr->end = next->start;
|
|
|
curr = next;
|
|
|
}
|
|
|
|
|
@@ -241,7 +242,8 @@ void __map_groups__fixup_end(struct map_groups *mg, enum map_type type)
|
|
|
* We still haven't the actual symbols, so guess the
|
|
|
* last map final address.
|
|
|
*/
|
|
|
- curr->end = ~0ULL;
|
|
|
+ if (!curr->end)
|
|
|
+ curr->end = ~0ULL;
|
|
|
|
|
|
out_unlock:
|
|
|
pthread_rwlock_unlock(&maps->lock);
|
|
@@ -552,7 +554,7 @@ void dso__sort_by_name(struct dso *dso, enum map_type type)
|
|
|
|
|
|
int modules__parse(const char *filename, void *arg,
|
|
|
int (*process_module)(void *arg, const char *name,
|
|
|
- u64 start))
|
|
|
+ u64 start, u64 size))
|
|
|
{
|
|
|
char *line = NULL;
|
|
|
size_t n;
|
|
@@ -565,8 +567,8 @@ int modules__parse(const char *filename, void *arg,
|
|
|
|
|
|
while (1) {
|
|
|
char name[PATH_MAX];
|
|
|
- u64 start;
|
|
|
- char *sep;
|
|
|
+ u64 start, size;
|
|
|
+ char *sep, *endptr;
|
|
|
ssize_t line_len;
|
|
|
|
|
|
line_len = getline(&line, &n, file);
|
|
@@ -598,7 +600,11 @@ int modules__parse(const char *filename, void *arg,
|
|
|
|
|
|
scnprintf(name, sizeof(name), "[%s]", line);
|
|
|
|
|
|
- err = process_module(arg, name, start);
|
|
|
+ size = strtoul(sep + 1, &endptr, 0);
|
|
|
+ if (*endptr != ' ' && *endptr != '\t')
|
|
|
+ continue;
|
|
|
+
|
|
|
+ err = process_module(arg, name, start, size);
|
|
|
if (err)
|
|
|
break;
|
|
|
}
|
|
@@ -945,7 +951,8 @@ static struct module_info *find_module(const char *name,
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-static int __read_proc_modules(void *arg, const char *name, u64 start)
|
|
|
+static int __read_proc_modules(void *arg, const char *name, u64 start,
|
|
|
+ u64 size __maybe_unused)
|
|
|
{
|
|
|
struct rb_root *modules = arg;
|
|
|
struct module_info *mi;
|