X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Flibcfs%2Ftracefile.h;h=3d838cf39e3549ed159bb35a0179ab1b84246a97;hp=14e33118df0a1e0ae7890099de824a29144ad7eb;hb=9dfbed6fa33dfcd69afa3383f20c3973215e8000;hpb=7092309f32516cbfb95a964c87b8030129edeb27 diff --git a/libcfs/libcfs/tracefile.h b/libcfs/libcfs/tracefile.h index 14e3311..3d838cf 100644 --- a/libcfs/libcfs/tracefile.h +++ b/libcfs/libcfs/tracefile.h @@ -23,7 +23,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2014, Intel Corporation. + * Copyright (c) 2012, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -42,8 +42,6 @@ enum cfs_trace_buf_type { CFS_TCD_TYPE_MAX }; -/* trace file lock routines */ - #define TRACEFILE_NAME_SIZE 1024 extern char cfs_tracefile[TRACEFILE_NAME_SIZE]; extern long long cfs_tracefile_size; @@ -58,11 +56,6 @@ extern void libcfs_run_debug_log_upcall(char *file); int cfs_tracefile_init_arch(void); void cfs_tracefile_fini_arch(void); -void cfs_tracefile_read_lock(void); -void cfs_tracefile_read_unlock(void); -void cfs_tracefile_write_lock(void); -void cfs_tracefile_write_unlock(void); - int cfs_tracefile_dump_all_pages(char *filename); void cfs_trace_debug_print(void); void cfs_trace_flush_pages(void); @@ -85,10 +78,7 @@ int cfs_trace_set_debug_mb(int mb); int cfs_trace_get_debug_mb(void); extern void libcfs_debug_dumplog_internal(void *arg); -extern void libcfs_register_panic_notifier(void); -extern void libcfs_unregister_panic_notifier(void); extern int libcfs_panic_in_progress; -extern int cfs_trace_max_debug_mb(void); #define TCD_MAX_PAGES (5 << (20 - PAGE_SHIFT)) #define TCD_STOCK_PAGES (TCD_MAX_PAGES) @@ -114,7 +104,7 @@ union cfs_trace_data_union { * Even though this structure is meant to be per-CPU, locking * is needed because in some places the data may be accessed * from other CPUs. This lock is directly used in trace_get_tcd - * and trace_put_tcd, which are called in libcfs_debug_vmsg2 and + * and trace_put_tcd, which are called in libcfs_debug_msg and * tcd_for_each_type_lock */ spinlock_t tcd_lock; @@ -193,11 +183,6 @@ extern union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS]; j < num_possible_cpus(); \ j++, (tcd) = &(*cfs_trace_data[i])[j].tcd) -#define cfs_tcd_for_each_type_lock(tcd, i, cpu) \ - for (i = 0; cfs_trace_data[i] && \ - (tcd = &(*cfs_trace_data[i])[cpu].tcd) && \ - cfs_trace_lock_tcd(tcd, 1); cfs_trace_unlock_tcd(tcd, 1), i++) - /* XXX nikita: this declaration is internal to tracefile.c and should probably * be moved there */ struct page_collection { @@ -249,16 +234,6 @@ struct cfs_trace_page { unsigned short type; }; -extern void cfs_set_ptldebug_header(struct ptldebug_header *header, - struct libcfs_debug_msg_data *m, - unsigned long stack); -extern void cfs_print_to_console(struct ptldebug_header *hdr, int mask, - const char *buf, int len, const char *file, - const char *fn); - -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); - extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX]; extern enum cfs_trace_buf_type cfs_trace_buf_idx_get(void); @@ -270,26 +245,6 @@ static inline char *cfs_trace_get_console_buffer(void) return cfs_trace_console_buffers[i][j]; } -static inline struct cfs_trace_cpu_data *cfs_trace_get_tcd(void) -{ - struct cfs_trace_cpu_data *tcd = - &(*cfs_trace_data[cfs_trace_buf_idx_get()])[get_cpu()].tcd; - - cfs_trace_lock_tcd(tcd, 0); - - return tcd; -} - -static inline void cfs_trace_put_tcd(struct cfs_trace_cpu_data *tcd) -{ - cfs_trace_unlock_tcd(tcd, 0); - put_cpu(); -} - -int cfs_trace_refill_stock(struct cfs_trace_cpu_data *tcd, gfp_t gfp, - struct list_head *stock); - - int cfs_tcd_owns_tage(struct cfs_trace_cpu_data *tcd, struct cfs_trace_page *tage); @@ -297,21 +252,21 @@ extern void cfs_trace_assertion_failed(const char *str, struct libcfs_debug_msg_data *m); /* ASSERTION that is safe to use within the debug system */ -#define __LASSERT(cond) \ -do { \ - if (unlikely(!(cond))) { \ - LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \ - cfs_trace_assertion_failed("ASSERTION("#cond") failed", \ - &msgdata); \ - } \ +#define __LASSERT(cond) \ +do { \ + if (unlikely(!(cond))) { \ + LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \ + cfs_trace_assertion_failed("ASSERTION("#cond") failed", \ + &msgdata); \ + } \ } while (0) -#define __LASSERT_TAGE_INVARIANT(tage) \ -do { \ - __LASSERT(tage != NULL); \ - __LASSERT(tage->page != NULL); \ - __LASSERT(tage->used <= PAGE_SIZE); \ - __LASSERT(page_count(tage->page) > 0); \ +#define __LASSERT_TAGE_INVARIANT(tage) \ +do { \ + __LASSERT(tage != NULL); \ + __LASSERT(tage->page != NULL); \ + __LASSERT(tage->used <= PAGE_SIZE); \ + __LASSERT(page_count(tage->page) > 0); \ } while (0) #endif /* LUSTRE_TRACEFILE_PRIVATE */