#include <dirent.h>
#include "internal_config.h"
+#include "mc_memory_map.h"
#include "mc_private.h"
#include "xbt/module.h"
#include <xbt/mmalloc.h>
#include "mc_private.h"
#include <mc/mc.h>
+#include "mc_snapshot.h"
+#include "mc_object_info.h"
#include "mc_mmu.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_checkpoint, mc,
size_t total_fd = 0;
struct dirent* fd_number;
- while (fd_number = readdir(fd_dir)) {
+ while ((fd_number = readdir(fd_dir))) {
int fd_value = atoi(fd_number->d_name);
const size_t link_size = 200;
char link[200];
- size_t res = readlink(source, link, link_size);
+ int res = readlink(source, link, link_size);
if (res<0) {
xbt_die("Could not read link for %s", source);
}
if (strncmp(link, "pipe:", 5) == 0 || strncmp(link, "socket:", 7) == 0)
continue;
+ // If dot_output enabled, do not handle the corresponding file
+ if (dot_output != NULL && strcmp(basename(link), _sg_mc_dot_output_file) == 0)
+ continue;
+
+ // This is probably a shared memory used by lttng-ust:
+ if(strncmp("/dev/shm/ust-shm-tmp-", link, 21)==0)
+ continue;
+
// Add an entry for this FD in the snapshot:
fd_infos_t fd = xbt_new0(s_fd_infos_t, 1);
fd->filename = strdup(link);