|
@@ -5,6 +5,7 @@
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
|
|
+#include <linux/mman.h>
|
|
#include <sys/types.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/param.h>
|
|
#include <sys/param.h>
|
|
@@ -1217,7 +1218,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
|
|
}
|
|
}
|
|
|
|
|
|
/* Read new maps into temporary lists */
|
|
/* Read new maps into temporary lists */
|
|
- err = file__read_maps(fd, md.type == MAP__FUNCTION, kcore_mapfn, &md,
|
|
|
|
|
|
+ err = file__read_maps(fd, map->prot & PROT_EXEC, kcore_mapfn, &md,
|
|
&is_64_bit);
|
|
&is_64_bit);
|
|
if (err)
|
|
if (err)
|
|
goto out_err;
|
|
goto out_err;
|
|
@@ -1285,7 +1286,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
|
|
|
|
|
|
close(fd);
|
|
close(fd);
|
|
|
|
|
|
- if (map->type == MAP__FUNCTION)
|
|
|
|
|
|
+ if (map->prot & PROT_EXEC)
|
|
pr_debug("Using %s for kernel object code\n", kcore_filename);
|
|
pr_debug("Using %s for kernel object code\n", kcore_filename);
|
|
else
|
|
else
|
|
pr_debug("Using %s for kernel data\n", kcore_filename);
|
|
pr_debug("Using %s for kernel data\n", kcore_filename);
|