mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
debug: do not play with fds with valgring
When valgrind usage is desired by user (--enable-valgrind-pool) skip playing/closing/reopenning with descriptors - it makes valgridng useless. Make sleep delay for clvmd start longer.
This commit is contained in:
parent
ee7143cd02
commit
31d8c3ee85
@ -1349,6 +1349,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
|
|||||||
/* FIXME Make this configurable? */
|
/* FIXME Make this configurable? */
|
||||||
reset_lvm_errno(1);
|
reset_lvm_errno(1);
|
||||||
|
|
||||||
|
#ifndef VALGRIND_POOL
|
||||||
/* Set in/out stream buffering before glibc */
|
/* Set in/out stream buffering before glibc */
|
||||||
if (set_buffering) {
|
if (set_buffering) {
|
||||||
/* Allocate 2 buffers */
|
/* Allocate 2 buffers */
|
||||||
@ -1381,6 +1382,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
|
|||||||
} else
|
} else
|
||||||
/* Without buffering, must not use stdin/stdout */
|
/* Without buffering, must not use stdin/stdout */
|
||||||
init_silent(1);
|
init_silent(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Environment variable LVM_SYSTEM_DIR overrides this below.
|
* Environment variable LVM_SYSTEM_DIR overrides this below.
|
||||||
@ -1649,6 +1651,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
|||||||
if (cmd->libmem)
|
if (cmd->libmem)
|
||||||
dm_pool_destroy(cmd->libmem);
|
dm_pool_destroy(cmd->libmem);
|
||||||
|
|
||||||
|
#ifndef VALGRIND_POOL
|
||||||
if (cmd->linebuffer) {
|
if (cmd->linebuffer) {
|
||||||
/* Reset stream buffering to defaults */
|
/* Reset stream buffering to defaults */
|
||||||
if (is_valid_fd(STDIN_FILENO)) {
|
if (is_valid_fd(STDIN_FILENO)) {
|
||||||
@ -1669,6 +1672,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
|||||||
|
|
||||||
dm_free(cmd->linebuffer);
|
dm_free(cmd->linebuffer);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
dm_free(cmd);
|
dm_free(cmd);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ prepare_clvmd() {
|
|||||||
local local_clvmd=$!
|
local local_clvmd=$!
|
||||||
sleep .3
|
sleep .3
|
||||||
# extra sleep for slow valgrind
|
# extra sleep for slow valgrind
|
||||||
test -z "$LVM_VALGRIND_CLVMD" || sleep 5
|
test -z "$LVM_VALGRIND_CLVMD" || sleep 7
|
||||||
# check that it is really running now
|
# check that it is really running now
|
||||||
ps $local_clvmd || die
|
ps $local_clvmd || die
|
||||||
echo $local_clvmd > LOCAL_CLVMD
|
echo $local_clvmd > LOCAL_CLVMD
|
||||||
|
@ -1292,6 +1292,7 @@ static void _close_descriptor(int fd, unsigned suppress_warnings,
|
|||||||
|
|
||||||
static int _close_stray_fds(const char *command)
|
static int _close_stray_fds(const char *command)
|
||||||
{
|
{
|
||||||
|
#ifndef VALGRIND_POOL
|
||||||
struct rlimit rlim;
|
struct rlimit rlim;
|
||||||
int fd;
|
int fd;
|
||||||
unsigned suppress_warnings = 0;
|
unsigned suppress_warnings = 0;
|
||||||
@ -1331,6 +1332,7 @@ static int _close_stray_fds(const char *command)
|
|||||||
|
|
||||||
if (closedir(d))
|
if (closedir(d))
|
||||||
log_sys_error("closedir", _fd_dir);
|
log_sys_error("closedir", _fd_dir);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user