Skip to content

Commit f2ce01f

Browse files
committed
configure: --enable-pedantic
* This defines NO_DMTCP_PRGNAME_PREFIX; When defined, the 'DMTCP:' prefix will not be prepended to the comm field in 'ps' * This is needed for the CUDA ckpt API, which uses the 'comm' field on restart
1 parent 88d7de4 commit f2ce01f

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

configure

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ enable_test_suite
846846
enable_experts_only_space1
847847
enable_experts_only
848848
enable_experts_only_after
849+
enable_pedantic
849850
enable_fsgsbase_override
850851
enable_m32
851852
enable_multilib
@@ -1535,6 +1536,8 @@ Optional Features:
15351536
=== **** NOTE: EXPERTS ONLY BELOW HERE **** ===
15361537
(Use at your own risk!!)
15371538
1539+
--enable-pedantic Defines NO_DMTCP_PRGNAME_PREFIX, 'comm' in ps will
1540+
not use 'DMTCP:' prefix
15381541
--enable-fsgsbase-override
15391542
Defines HAS_FSGSBASE for cross-configure; The target
15401543
computer must have the FSGSBASE kernel patch.
@@ -8073,6 +8076,20 @@ then :
80738076
fi
80748077

80758078

8079+
# Check whether --enable-pedantic was given.
8080+
if test ${enable_pedantic+y}
8081+
then :
8082+
enableval=$enable_pedantic; use_pedantic=$enableval
8083+
else $as_nop
8084+
use_pedantic=no
8085+
fi
8086+
8087+
if test "$use_pedantic" = "yes"; then
8088+
8089+
printf "%s\n" "#define NO_DMTCP_PRGNAME_PREFIX 1" >>confdefs.h
8090+
8091+
fi
8092+
80768093
# Check whether --enable-fsgsbase-override was given.
80778094
if test ${enable_fsgsbase_override+y}
80788095
then :

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ AC_ARG_ENABLE([experts_only],
229229
[], [])
230230
AC_ARG_ENABLE([experts_only_after], [AS_HELP_STRING([ ], [])], [], [])
231231

232+
AC_ARG_ENABLE([pedantic],
233+
[AS_HELP_STRING([--enable-pedantic],
234+
[Defines NO_DMTCP_PRGNAME_PREFIX,
235+
'comm' in ps will not use 'DMTCP:' prefix])],
236+
[use_pedantic=$enableval],
237+
[use_pedantic=no])
238+
if test "$use_pedantic" = "yes"; then
239+
AC_DEFINE([NO_DMTCP_PRGNAME_PREFIX],[1],[Do not use 'DMTCP:' prefix
240+
in ps:comm (for CUDA ckpt)])
241+
fi
242+
232243
AC_ARG_ENABLE([fsgsbase-override],
233244
[AS_HELP_STRING([--enable-fsgsbase-override],
234245
[Defines HAS_FSGSBASE for cross-configure; The

include/config.h.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/* Define to 1 if you have the <inttypes.h> header file. */
5252
#undef HAVE_INTTYPES_H
5353

54-
/* Define to 1 if you have the 'atomic' library (-latomic). */
54+
/* Define to 1 if you have the `atomic' library (-latomic). */
5555
#undef HAVE_LIBATOMIC
5656

5757
/* Define to 1 if you have the <linux/version.h> header file. */
@@ -108,6 +108,9 @@
108108
/* Page size (sysconf(_SC_PAGESIZE)) */
109109
#undef MTCP_PAGE_SIZE
110110

111+
/* Do not use 'DMTCP:' prefix in ps:comm (for CUDA ckpt) */
112+
#undef NO_DMTCP_PRGNAME_PREFIX
113+
111114
/* Name of package */
112115
#undef PACKAGE
113116

@@ -132,7 +135,7 @@
132135
/* No output, not even NOTE and WARNING */
133136
#undef QUIET
134137

135-
/* Define to 1 if all of the C89 standard headers exist (not just the ones
138+
/* Define to 1 if all of the C90 standard headers exist (not just the ones
136139
required in a freestanding environment). This macro is provided for
137140
backward compatibility; new code need not use it. */
138141
#undef STDC_HEADERS

src/threadlist.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ stopthisthread(int signum)
659659
JASSERT(DmtcpRWLockUnlock(&threadResumeLock) == 0);
660660
} else {
661661
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
662+
# ifndef NO_DMTCP_PRGNAME_PREFIX
662663
if (!Util::strStartsWith(curThread->procname, DMTCP_PRGNAME_PREFIX)) {
663664
// Add the "DMTCP:" prefix.
664665
string newName = string(DMTCP_PRGNAME_PREFIX) + curThread->procname;
@@ -669,6 +670,7 @@ stopthisthread(int signum)
669670
// Add a NULL at the end to make sure the string terminates in all cases
670671
curThread->procname[sizeof(curThread->procname) - 1] = '\0';
671672
}
673+
# endif
672674
JASSERT(prctl(PR_SET_NAME, curThread->procname) != -1 || errno == EINVAL)
673675
(curThread->procname) (JASSERT_ERRNO)
674676
.Text("prctl(PR_SET_NAME, ...) failed");

0 commit comments

Comments
 (0)