symbol.c (c338aee853db197e1855b393e6d6cc667784537f) | symbol.c (fbd733b815a5a57d7eb0d904edc49d18fd12df5c) |
---|---|
1#include "util.h" 2#include "../perf.h" 3#include "string.h" 4#include "symbol.h" 5#include "thread.h" 6 7#include "debug.h" 8 --- 1320 unchanged lines hidden (view full) --- 1329 free(line); 1330out_failure: 1331 return -1; 1332} 1333 1334static int dso__load_vmlinux(struct dso *self, struct map *map, 1335 const char *vmlinux, symbol_filter_t filter) 1336{ | 1#include "util.h" 2#include "../perf.h" 3#include "string.h" 4#include "symbol.h" 5#include "thread.h" 6 7#include "debug.h" 8 --- 1320 unchanged lines hidden (view full) --- 1329 free(line); 1330out_failure: 1331 return -1; 1332} 1333 1334static int dso__load_vmlinux(struct dso *self, struct map *map, 1335 const char *vmlinux, symbol_filter_t filter) 1336{ |
1337 int err, fd = open(vmlinux, O_RDONLY); | 1337 int err = -1, fd; |
1338 | 1338 |
1339 self->loaded = 1; | 1339 if (self->has_build_id) { 1340 u8 build_id[BUILD_ID_SIZE]; |
1340 | 1341 |
1342 if (filename__read_build_id(vmlinux, build_id, 1343 sizeof(build_id)) < 0) { 1344 pr_debug("No build_id in %s, ignoring it\n", vmlinux); 1345 return -1; 1346 } 1347 if (!dso__build_id_equal(self, build_id)) { 1348 char expected_build_id[BUILD_ID_SIZE * 2 + 1], 1349 vmlinux_build_id[BUILD_ID_SIZE * 2 + 1]; 1350 1351 build_id__sprintf(self->build_id, 1352 sizeof(self->build_id), 1353 expected_build_id); 1354 build_id__sprintf(build_id, sizeof(build_id), 1355 vmlinux_build_id); 1356 pr_debug("build_id in %s is %s while expected is %s, " 1357 "ignoring it\n", vmlinux, vmlinux_build_id, 1358 expected_build_id); 1359 return -1; 1360 } 1361 } 1362 1363 fd = open(vmlinux, O_RDONLY); |
|
1341 if (fd < 0) 1342 return -1; 1343 | 1364 if (fd < 0) 1365 return -1; 1366 |
1367 self->loaded = 1; |
|
1344 err = dso__load_sym(self, map, self->long_name, fd, filter, 1, 0); 1345 1346 close(fd); 1347 1348 return err; 1349} 1350 1351static int dso__load_kernel_sym(struct dso *self, struct map *map, --- 124 unchanged lines hidden --- | 1368 err = dso__load_sym(self, map, self->long_name, fd, filter, 1, 0); 1369 1370 close(fd); 1371 1372 return err; 1373} 1374 1375static int dso__load_kernel_sym(struct dso *self, struct map *map, --- 124 unchanged lines hidden --- |