X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Flibcfs%2Ftracefile.c;h=63a23ef7c717e86b85c0daa266d5051f63a83d88;hp=5a29dfaa41465acf56bcb265efe55a1a2e6643ba;hb=744f5f8e6d8b902953431b0a39542b86c09275b1;hpb=6c80ca6ae2fdecc8653b8309b61d602c2746033d diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index 5a29dfa..63a23ef 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -245,7 +245,7 @@ int libcfs_debug_vmsg2(cfs_debug_limit_state_t *cdls, int subsys, int mask, const char *format2, ...) { struct cfs_trace_cpu_data *tcd = NULL; - struct ptldebug_header header; + struct ptldebug_header header = {0}; struct cfs_trace_page *tage; /* string_buf is used only if tcd != NULL, and is always set then */ char *string_buf = NULL; @@ -268,6 +268,9 @@ int libcfs_debug_vmsg2(cfs_debug_limit_state_t *cdls, int subsys, int mask, if (tcd == NULL) /* arch may not log in IRQ context */ goto console; + if (tcd->tcd_cur_pages == 0) + header.ph_flags |= PH_FLAG_FIRST_RECORD; + if (tcd->tcd_shutting_down) { cfs_trace_put_tcd(tcd); tcd = NULL; @@ -961,7 +964,6 @@ static int tracefiled(void *arg) struct tracefiled_ctl *tctl = arg; struct cfs_trace_page *tage; struct cfs_trace_page *tmp; - struct ptldebug_header *hdr; cfs_file_t *filp; int last_loop = 0; int rc; @@ -1002,13 +1004,6 @@ static int tracefiled(void *arg) CFS_MMSPACE_OPEN; - /* mark the first header, so we can sort in chunks */ - tage = cfs_tage_from_list(pc.pc_pages.next); - __LASSERT_TAGE_INVARIANT(tage); - - hdr = cfs_page_address(tage->page); - hdr->ph_flags |= PH_FLAG_FIRST_RECORD; - cfs_list_for_each_entry_safe_typed(tage, tmp, &pc.pc_pages, struct cfs_trace_page, linkage) {