summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b2d7335)
While it was possible to set "lctl set_param debug_path=path" or
"echo path > /sys/module/libcfs/parameters/libcfs_debug_file_path"
this change does not affect the path used to dump debug logs.
Connect these parameters to the pathname used for the debug log.
Test-Parameters: testlist=sanity env=ONLY=60f,ONLY_REPEAT=30
Fixes:
7092309f325 ("LU-8066 libcfs: migrate to debugfs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ic18b5b24d1ac939c09637e66a342f5e3622367c3
Reviewed-on: https://review.whamcloud.com/43109
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
extern unsigned int libcfs_console_min_delay;
extern unsigned int libcfs_console_backoff;
extern unsigned int libcfs_debug_binary;
extern unsigned int libcfs_console_min_delay;
extern unsigned int libcfs_console_backoff;
extern unsigned int libcfs_debug_binary;
-extern char libcfs_debug_file_path_arr[PATH_MAX];
+extern char *libcfs_debug_file_path;
static DECLARE_COMPLETION(debug_complete);
static DECLARE_COMPLETION(debug_complete);
-char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
-EXPORT_SYMBOL(libcfs_debug_file_path_arr);
-
/* We need to pass a pointer here, but elsewhere this must be a const */
/* We need to pass a pointer here, but elsewhere this must be a const */
-static char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
+char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
+EXPORT_SYMBOL(libcfs_debug_file_path);
module_param(libcfs_debug_file_path, charp, 0644);
MODULE_PARM_DESC(libcfs_debug_file_path,
"Path for dumping debug logs, set 'NONE' to prevent log dumping");
module_param(libcfs_debug_file_path, charp, 0644);
MODULE_PARM_DESC(libcfs_debug_file_path,
"Path for dumping debug logs, set 'NONE' to prevent log dumping");
current_time = ktime_get_real_seconds();
current_time = ktime_get_real_seconds();
- if (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0 &&
+ if (strncmp(libcfs_debug_file_path, "NONE", 4) != 0 &&
current_time > last_dump_time) {
last_dump_time = current_time;
snprintf(debug_file_name, sizeof(debug_file_name) - 1,
current_time > last_dump_time) {
last_dump_time = current_time;
snprintf(debug_file_name, sizeof(debug_file_name) - 1,
- "%s.%lld.%ld", libcfs_debug_file_path_arr,
+ "%s.%lld.%ld", libcfs_debug_file_path,
(s64)current_time, (uintptr_t)arg);
pr_alert("LustreError: dumping log to %s\n", debug_file_name);
cfs_tracefile_dump_all_pages(debug_file_name);
(s64)current_time, (uintptr_t)arg);
pr_alert("LustreError: dumping log to %s\n", debug_file_name);
cfs_tracefile_dump_all_pages(debug_file_name);
libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
}
libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
}
- if (libcfs_debug_file_path) {
- strlcpy(libcfs_debug_file_path_arr,
- libcfs_debug_file_path,
- sizeof(libcfs_debug_file_path_arr));
- }
-
/* If libcfs_debug_mb is uninitialized then just make the
* total buffers smp_num_cpus * TCD_MAX_PAGES
*/
/* If libcfs_debug_mb is uninitialized then just make the
* total buffers smp_num_cpus * TCD_MAX_PAGES
*/
* file/fid, not during the resends/retries. */
snprintf(dbgcksum_file_name, sizeof(dbgcksum_file_name),
"%s-checksum_dump-osc-"DFID":[%llu-%llu]-%x-%x",
* file/fid, not during the resends/retries. */
snprintf(dbgcksum_file_name, sizeof(dbgcksum_file_name),
"%s-checksum_dump-osc-"DFID":[%llu-%llu]-%x-%x",
- (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0 ?
- libcfs_debug_file_path_arr :
- LIBCFS_DEBUG_FILE_PATH_DEFAULT),
+ (strncmp(libcfs_debug_file_path, "NONE", 4) != 0 ?
+ libcfs_debug_file_path : LIBCFS_DEBUG_FILE_PATH_DEFAULT),
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
* file/fid, not during the resends/retries. */
snprintf(dbgcksum_file_name, sizeof(dbgcksum_file_name),
"%s-checksum_dump-ost-"DFID":[%llu-%llu]-%x-%x",
* file/fid, not during the resends/retries. */
snprintf(dbgcksum_file_name, sizeof(dbgcksum_file_name),
"%s-checksum_dump-ost-"DFID":[%llu-%llu]-%x-%x",
- (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0 ?
- libcfs_debug_file_path_arr :
- LIBCFS_DEBUG_FILE_PATH_DEFAULT),
+ (strncmp(libcfs_debug_file_path, "NONE", 4) != 0 ?
+ libcfs_debug_file_path : LIBCFS_DEBUG_FILE_PATH_DEFAULT),
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
}
run_test 60e "no space while new llog is being created"
}
run_test 60e "no space while new llog is being created"
+test_60f() {
+ local old_path=$($LCTL get_param -n debug_path)
+
+ stack_trap "$LCTL set_param debug_path=$old_path"
+ stack_trap "rm -f $TMP/$tfile*"
+ #define OBD_FAIL_PTLRPC_DUMP_LOG 0x50e
+ $LCTL set_param debug_path=$TMP/$tfile fail_loc=0x8000050e
+ test_mkdir $DIR/$tdir
+ rm -f $TMP/$tfile* 2> /dev/null
+ # retry in case the open is cached and not released
+ for (( i = 0; i < 100 && $(ls $TMP/$tfile* | wc -l) == 0; i++ )); do
+ echo $i > $DIR/$tdir/$tfile.$i && cat $DIR/$tdir/$tfile.$i
+ sleep 0.1
+ done
+ ls $TMP/$tfile*
+ (( $(ls $TMP/$tfile* | wc -l) > 0 )) || error "$TMP/$tfile not dumped"
+}
+run_test 60f "change debug_path works"
+
test_60g() {
local pid
local i
test_60g() {
local pid
local i