X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Flibcfs%2Ftracefile.h;h=d1892957d2d3ff6e40da342c65847ac38782a4fa;hp=3aa8989ac06959cac283959551f539e8464194c4;hb=015d4763eb41be60731aa62aac58b568c9fc2b16;hpb=001b8dbfacb747f1649a2eb047a5f118ce32fdc7 diff --git a/libcfs/libcfs/tracefile.h b/libcfs/libcfs/tracefile.h index 3aa8989..d189295 100644 --- a/libcfs/libcfs/tracefile.h +++ b/libcfs/libcfs/tracefile.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -39,23 +39,25 @@ #include -#ifdef __KERNEL__ -#if defined(__linux__) -#include "linux/linux-tracefile.h" -#elif defined(__WINNT__) -#include "winnt/winnt-tracefile.h" -#else -#error Unsupported operating system. -#endif -#else -#include "posix/posix-tracefile.h" -#endif +typedef enum { + CFS_TCD_TYPE_PROC = 0, + CFS_TCD_TYPE_SOFTIRQ, + CFS_TCD_TYPE_IRQ, + CFS_TCD_TYPE_MAX +} cfs_trace_buf_type_t; + /* trace file lock routines */ #define TRACEFILE_NAME_SIZE 1024 extern char cfs_tracefile[TRACEFILE_NAME_SIZE]; extern long long cfs_tracefile_size; +extern char lnet_upcall[1024]; +/** + * The path of debug log dump upcall script. + */ +extern char lnet_debug_log_upcall[1024]; + extern void libcfs_run_debug_log_upcall(char *file); int cfs_tracefile_init_arch(void); @@ -77,16 +79,16 @@ void cfs_tracefile_exit(void); int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, - const char *usr_buffer, int usr_buffer_nob); -int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob, + const char __user *usr_buffer, int usr_buffer_nob); +int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, const char *knl_str, char *append); int cfs_trace_allocate_string_buffer(char **str, int nob); void cfs_trace_free_string_buffer(char *str, int nob); -int cfs_trace_dump_debug_buffer_usrstr(void *usr_str, int usr_str_nob); +int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob); int cfs_trace_daemon_command(char *str); -int cfs_trace_daemon_command_usrstr(void *usr_str, int usr_str_nob); +int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob); int cfs_trace_set_debug_mb(int mb); -int cfs_trace_set_debug_mb_usrstr(void *usr_str, int usr_str_nob); +int cfs_trace_set_debug_mb_usrstr(void __user *usr_str, int usr_str_nob); int cfs_trace_get_debug_mb(void); extern void libcfs_debug_dumplog_internal(void *arg); @@ -264,13 +266,6 @@ extern void cfs_print_to_console(struct ptldebug_header *hdr, int mask, extern int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking); extern void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking); -/** - * trace_buf_type_t, trace_buf_idx_get() and trace_console_buffers[][] - * are not public libcfs API; they should be defined in - * platform-specific tracefile include files - * (see, for example, linux-tracefile.h). - */ - extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX]; extern cfs_trace_buf_type_t cfs_trace_buf_idx_get(void); @@ -304,7 +299,7 @@ static inline void cfs_trace_put_tcd(struct cfs_trace_cpu_data *tcd) put_cpu(); } -int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, int gfp, +int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, gfp_t gfp, struct list_head *stock);