mcexec: Fix debug/error messages

This commit is contained in:
Masamichi Takagi
2017-07-12 14:30:21 +09:00
parent 6415dcfdcc
commit 6afea4af48

View File

@@ -592,7 +592,7 @@ retry:
/* Check whether the resolved path is a symlink */ /* Check whether the resolved path is a symlink */
if (lstat(path, &sb) == -1) { if (lstat(path, &sb) == -1) {
__dprintf(stderr, "lookup_exec_path(): error stat\n"); __eprint("lookup_exec_path(): error stat\n");
return errno; return errno;
} }
@@ -1736,7 +1736,7 @@ int main(int argc, char **argv)
envs_len = flatten_strings(-1, NULL, environ, &envs); envs_len = flatten_strings(-1, NULL, environ, &envs);
#ifdef ENABLE_MCOVERLAYFS #ifdef ENABLE_MCOVERLAYFS
__dprintf("mcoverlay enable\n"); __dprint("mcoverlay enable\n");
char mcos_procdir[PATH_MAX]; char mcos_procdir[PATH_MAX];
char mcos_sysdir[PATH_MAX]; char mcos_sysdir[PATH_MAX];
@@ -2043,16 +2043,15 @@ int main(int argc, char **argv)
/* This call may not succeed, but that is fine */ /* This call may not succeed, but that is fine */
if (sched_setaffinity(0, sizeof(mcexec_cpu_set), if (sched_setaffinity(0, sizeof(mcexec_cpu_set),
&mcexec_cpu_set) < 0) { &mcexec_cpu_set) < 0) {
__dprint("%s: WARNING: couldn't bind to mcexec_cpu_set\n", __dprint("WARNING: couldn't bind to mcexec_cpu_set\n");
__FUNCTION__);
} }
#ifdef DEBUG #ifdef DEBUG
else { else {
int i; int i;
for (i = 0; i < numa_num_possible_cpus(); ++i) { for (i = 0; i < numa_num_possible_cpus(); ++i) {
if (CPU_ISSET(i, &mcexec_cpu_set)) { if (CPU_ISSET(i, &mcexec_cpu_set)) {
__dprint("%s: PID %d bound to CPU %d\n", __dprintf("PID %d bound to CPU %d\n",
__FUNCTION__, getpid(), i); getpid(), i);
} }
} }
} }
@@ -2061,8 +2060,8 @@ int main(int argc, char **argv)
else { else {
/* This call may not succeed, but that is fine */ /* This call may not succeed, but that is fine */
if (numa_run_on_node(mcexec_linux_numa) < 0) { if (numa_run_on_node(mcexec_linux_numa) < 0) {
__dprint("%s: WARNING: couldn't bind to NUMA %d\n", __dprintf("WARNING: couldn't bind to NUMA %d\n",
__FUNCTION__, mcexec_linux_numa); mcexec_linux_numa);
} }
#ifdef DEBUG #ifdef DEBUG
else { else {
@@ -2081,8 +2080,8 @@ int main(int argc, char **argv)
sprintf(affinity, "%s %d", affinity, i); sprintf(affinity, "%s %d", affinity, i);
} }
} }
__dprint("%s: PID: %d affinity: %s\n", __dprintf("PID: %d affinity: %s\n",
__FUNCTION__, getpid(), affinity); getpid(), affinity);
} }
#endif // DEBUG #endif // DEBUG
} }