Move tracing out of yportenv.h
authorcharles <charles>
Mon, 11 Jan 2010 04:06:46 +0000 (04:06 +0000)
committercharles <charles>
Mon, 11 Jan 2010 04:06:46 +0000 (04:06 +0000)
21 files changed:
direct/Makefile
direct/python/Makefile
direct/python/yaffs_python_helper.c
direct/tests/Makefile
direct/tests/yaffs_test.c
direct/yaffs_fileem.c
direct/yaffs_fileem2k.c
direct/yaffs_norif1.c
direct/yaffs_ramdisk.c
direct/yaffs_ramem2k.c
direct/yaffscfg2k.c
direct/yaffsfs.c
yaffs_fs.c
yaffs_getblockinfo.h
yaffs_guts.c
yaffs_mtdif1.c
yaffs_mtdif2.c
yaffs_packedtags2.c
yaffs_tagscompat.c
yaffs_trace.h [new file with mode: 0644]
yportenv.h

index ead70e1940bef40671028bc98536f1646376f351..0f2b7ed11c66f70f310ab77394b6f85edd609dc7 100644 (file)
@@ -14,7 +14,7 @@
 #
 # NB Warning this Makefile does not include header dependencies.
 #
-# $Id: Makefile,v 1.22 2009-01-04 21:44:24 charles Exp $
+# $Id: Makefile,v 1.23 2010-01-11 04:06:47 charles Exp $
 
 #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
 
@@ -48,7 +48,7 @@ SYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffsin
           yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h  yaffs_nandemul2k.h \
           yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
           yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
-          yaffs_qsort.c yaffs_qsort.h
+          yaffs_qsort.c yaffs_qsort.h yaffs_trace.h
 
 #all: directtest2k boottest
 
index f9f42b80977cc626cdf00a1d2db4be6f6a28ed76..888854fc485e2a07c605010724a9ea7ccdbc4243 100644 (file)
@@ -14,7 +14,7 @@
 #
 # NB Warning this Makefile does not include header dependencies.
 #
-# $Id: Makefile,v 1.4 2009-10-12 23:05:49 charles Exp $
+# $Id: Makefile,v 1.5 2010-01-11 04:06:47 charles Exp $
 
 #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
 
@@ -50,7 +50,7 @@ YAFFSDIRECTSYMLINKS =  yaffscfg2k.c yaffs_fileem2k.c yaffsfs.c yaffs_flashif.h y
                       yaffs_fileem2k.h yaffsfs.h yaffs_malloc.h yaffs_ramdisk.h ydirectenv.h \
                       yaffscfg.h yaffs_fileem.c yaffs_flashif.c yaffs_ramdisk.c yaffs_ramem2k.c\
                       yaffs_norif1.c yaffs_norif1.h ynorsim.c ynorsim.h \
-                      yaffs_nandif.c yaffs_nandif.h
+                      yaffs_nandif.c yaffs_nandif.h yaffs_trace.h
 
 
 SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS)
index cbb434c880b30ef8ca75e71a8b342e0b9b77eea7..0a523e63c52bf8a9f2bf898c4766471a11a44011 100644 (file)
@@ -22,6 +22,7 @@
  */
  
 #include "yaffsfs.h"
+#include "yaffs_trace.h"
 
 int simulate_power_failure;
 int random_seed;
index f4b397473ac551a31f2d7c11c03e67daa3190504..fe12adf1e8aeaad824a4ff386ea3d295c92cc39b 100644 (file)
@@ -14,7 +14,7 @@
 #
 # NB Warning this Makefile does not include header dependencies.
 #
-# $Id: Makefile,v 1.5 2009-12-14 19:46:27 charles Exp $
+# $Id: Makefile,v 1.6 2010-01-11 04:06:47 charles Exp $
 
 #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
 
@@ -48,7 +48,7 @@ YAFFSSYMLINKS = devextras.h yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h ya
           yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h  yaffs_nandemul2k.h \
           yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
           yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
-          yaffs_qsort.c yaffs_qsort.h
+          yaffs_qsort.c yaffs_qsort.h yaffs_trace.h
 
 YAFFSDIRECTSYMLINKS =  yaffscfg2k.c yaffs_fileem2k.c yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffs_fileem2k.h yaffsfs.h yaffs_malloc.h yaffs_ramdisk.h ydirectenv.h \
index 9b36e08399120c9c44174b8ed322abd31906ca7e..faf5bef0f73df94685b0388d0544c6c4ddd6151b 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "yaffsfs.h"
 
+#include "yaffs_trace.h"
+
 #include "nor_stress.h"
 #include "yaffs_fsx.h"
 
index 6f93972c813aad938550278a44b39555f1916d0a..6953a68018ec8979b61a7864b633d49d7941eb61 100644 (file)
  * This is only intended as test code to test persistence etc.
  */
 
-const char *yaffs_flashif_c_version = "$Id: yaffs_fileem.c,v 1.5 2009-01-12 00:49:01 charles Exp $";
+const char *yaffs_flashif_c_version = "$Id: yaffs_fileem.c,v 1.6 2010-01-11 04:06:47 charles Exp $";
 
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffs_flashif.h"
 #include "yaffs_guts.h"
index 9ef488e3918ff4eee3b1dc34c3f85a9165f3ac6d..a4a652f49bf12f56d41715a817f12e9e6b77877c 100644 (file)
  * This is only intended as test code to test persistence etc.
  */
 
-const char *yaffs_flashif2_c_version = "$Id: yaffs_fileem2k.c,v 1.21 2009-11-07 22:35:15 charles Exp $";
+const char *yaffs_flashif2_c_version = "$Id: yaffs_fileem2k.c,v 1.22 2010-01-11 04:06:47 charles Exp $";
 
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffs_flashif2.h"
 #include "yaffs_guts.h"
index 06bea3dc7218b2aa5be273faa7185bd0400ed410..8753e4ee952ebe8caf8865d13697c5f22b5f7e23 100644 (file)
  *   
  */
 
-const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.4 2009-01-09 02:54:14 charles Exp $";
+const char *yaffs_norif1_c_version = "$Id: yaffs_norif1.c,v 1.5 2010-01-11 04:06:47 charles Exp $";
 
 #include "yaffs_norif1.h"
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffs_flashif.h"
 #include "yaffs_guts.h"
index fa76b6c30eff9b8e847903e5c36837822c374769..0889fb23c2d531ae3092e5c7cbd65425f62d2c96 100644 (file)
  * Use this with dev->useNANDECC enabled, then ECC overheads are not required.
  */
 
-const char *yaffs_ramdisk_c_version = "$Id: yaffs_ramdisk.c,v 1.5 2008-05-05 07:58:58 charles Exp $";
+const char *yaffs_ramdisk_c_version = "$Id: yaffs_ramdisk.c,v 1.6 2010-01-11 04:06:47 charles Exp $";
 
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffs_ramdisk.h"
 #include "yaffs_guts.h"
index 767dceae262b7c8b923cff943bae8815311917c6..6ebb75a227bde9ce0909da0b4c93abbb364bd76c 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 
-const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.5 2009-10-14 00:01:57 charles Exp $";
+const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.6 2010-01-11 04:06:47 charles Exp $";
 
 #ifndef __KERNEL__
 #define CONFIG_YAFFS_RAM_ENABLED
@@ -27,6 +27,7 @@ const char *yaffs_ramem2k_c_version = "$Id: yaffs_ramem2k.c,v 1.5 2009-10-14 00:
 #ifdef CONFIG_YAFFS_RAM_ENABLED
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffs_nandemul2k.h"
 #include "yaffs_guts.h"
index 41048bc0d9b6d1a46e58ccaf3973304682318379..3118fa0f7b756d031323d936d36c2fea6f380145 100644 (file)
@@ -23,6 +23,7 @@
 #include "yaffs_fileem2k.h"
 #include "yaffs_nandemul2k.h"
 #include "yaffs_norif1.h"
+#include "yaffs_trace.h"
 
 #include <errno.h>
 
index 645db71462691b5037e4dda29447b1ff5c0f3ced..cc7eb643e19779f6493b902b71e9b345f501346a 100644 (file)
 #include "yaffsfs.h"
 #include "yaffs_guts.h"
 #include "yaffscfg.h"
-#include <string.h> // for memset
 #include "yportenv.h"
+#include "yaffs_trace.h"
+
+#include <string.h> // for memset
 
 #define YAFFSFS_MAX_SYMLINK_DEREFERENCES 5
 
@@ -24,7 +26,7 @@
 #endif
 
 
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.30 2010-01-06 04:00:23 charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.31 2010-01-11 04:06:47 charles Exp $";
 
 // configurationList is the list of devices that are supported
 static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
index a62724fe16e5d8c81b19917dfce6c6ce2b1491d3..39de0740d28ae2d9743f5b019188574081c93bdd 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 const char *yaffs_fs_c_version =
-    "$Id: yaffs_fs.c,v 1.90 2009-12-23 03:14:17 charles Exp $";
+    "$Id: yaffs_fs.c,v 1.91 2010-01-11 04:06:46 charles Exp $";
 extern const char *yaffs_guts_c_version;
 
 #include <linux/version.h>
@@ -114,6 +114,7 @@ static uint32_t YCALCBLOCKS(uint64_t partition_size, uint32_t block_size)
 #include <linux/uaccess.h>
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 #include "yaffs_guts.h"
 
 #include <linux/mtd/mtd.h>
@@ -1585,7 +1586,7 @@ static int yaffs_sync_object(struct file *file, struct dentry *dentry,
 
        dev = obj->myDev;
 
-       T(YAFFS_TRACE_OS, ("yaffs_sync_object\n"));
+       T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_sync_object\n"));
        yaffs_GrossLock(dev);
        yaffs_FlushFile(obj, 1, datasync);
        yaffs_GrossUnlock(dev);
@@ -1776,7 +1777,7 @@ static int yaffs_do_sync_fs(struct super_block *sb)
 {
 
        yaffs_Device *dev = yaffs_SuperToDevice(sb);
-       T(YAFFS_TRACE_OS, ("yaffs_do_sync_fs\n"));
+       T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_do_sync_fs\n"));
 
        if (sb->s_dirt) {
                yaffs_GrossLock(dev);
@@ -1802,7 +1803,7 @@ static int yaffs_write_super(struct super_block *sb)
 #endif
 {
 
-       T(YAFFS_TRACE_OS, ("yaffs_write_super\n"));
+       T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_write_super\n"));
        if (yaffs_auto_checkpoint >= 2)
                yaffs_do_sync_fs(sb);
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
@@ -1817,7 +1818,7 @@ static int yaffs_sync_fs(struct super_block *sb, int wait)
 static int yaffs_sync_fs(struct super_block *sb)
 #endif
 {
-       T(YAFFS_TRACE_OS, ("yaffs_sync_fs\n"));
+       T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_sync_fs\n"));
 
        if (yaffs_auto_checkpoint >= 1)
                yaffs_do_sync_fs(sb);
@@ -2593,6 +2594,7 @@ static struct {
        {"scan_debug", YAFFS_TRACE_SCAN_DEBUG},
        {"scan", YAFFS_TRACE_SCAN},
        {"tracing", YAFFS_TRACE_TRACING},
+       {"sync", YAFFS_TRACE_SYNC},
 
        {"verify", YAFFS_TRACE_VERIFY},
        {"verify_nand", YAFFS_TRACE_VERIFY_NAND},
index 5b0a1ac24bf7e31890c5131f28f5ce6ed64065f6..c8ff77798ea57956d9f74c50d59ecd656431ef42 100644 (file)
@@ -17,6 +17,7 @@
 #define __YAFFS_GETBLOCKINFO_H__
 
 #include "yaffs_guts.h"
+#include "yaffs_trace.h"
 
 /* Function to manipulate block info */
 static Y_INLINE yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blk)
index f9819f0428b578cb532d3a7a48ebdf9c44d44273..6658918cc8906dd08bcd432efcfcd41a2bd155a0 100644 (file)
  */
 
 const char *yaffs_guts_c_version =
-    "$Id: yaffs_guts.c,v 1.105 2010-01-06 04:02:12 charles Exp $";
+    "$Id: yaffs_guts.c,v 1.106 2010-01-11 04:06:46 charles Exp $";
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 
 #include "yaffsinterface.h"
 #include "yaffs_guts.h"
index 00fa4f2122e9e6148e1c86a629bef0b15a9be34e..990e0fb7673801a3fd439f27163b118b9db5100c 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include "yportenv.h"
+#include "yaffs_trace.h"
 #include "yaffs_guts.h"
 #include "yaffs_packedtags1.h"
 #include "yaffs_tagscompat.h"  /* for yaffs_CalcTagsECC */
@@ -36,7 +37,7 @@
 /* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
 #if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
 
-const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.11 2009-09-09 03:03:01 charles Exp $";
+const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.12 2010-01-11 04:06:46 charles Exp $";
 
 #ifndef CONFIG_YAFFS_9BYTE_TAGS
 # define YTAG1_SIZE 8
index 918f8de2b6aa95f6cd8a2fb5e363431fad27ea34..b814b47c2c56cce05c0cbdda02f7e994f475f3fc 100644 (file)
 /* mtd interface for YAFFS2 */
 
 const char *yaffs_mtdif2_c_version =
-       "$Id: yaffs_mtdif2.c,v 1.24 2009-10-14 00:01:57 charles Exp $";
+       "$Id: yaffs_mtdif2.c,v 1.25 2010-01-11 04:06:46 charles Exp $";
 
 #include "yportenv.h"
-
+#include "yaffs_trace.h"
 
 #include "yaffs_mtdif2.h"
 
index e0c55862d04597b26462aaadeda75a4b9387c384..e33e8a3ac37f1d3e118deb95624cb1243d6b5b29 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "yaffs_packedtags2.h"
 #include "yportenv.h"
+#include "yaffs_trace.h"
 #include "yaffs_tagsvalidity.h"
 
 /* This code packs a set of extended tags into a binary structure for
index e3173cc2e23b1d237928a298ef221c7829535203..020eee5356734e84f459885771590d52496d5dec 100644 (file)
@@ -15,6 +15,7 @@
 #include "yaffs_tagscompat.h"
 #include "yaffs_ecc.h"
 #include "yaffs_getblockinfo.h"
+#include "yaffs_trace.h"
 
 static void yaffs_HandleReadDataError(yaffs_Device *dev, int chunkInNAND);
 #ifdef NOTYET
diff --git a/yaffs_trace.h b/yaffs_trace.h
new file mode 100644 (file)
index 0000000..5ddb977
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2007 Aleph One Ltd.
+ *   for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Charles Manning <charles@aleph1.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ */
+
+
+#ifndef __YTRACE_H__
+#define __YTRACE_H__
+
+extern unsigned int yaffs_traceMask;
+extern unsigned int yaffs_wr_attempts;
+
+/*
+ * Tracing flags.
+ * The flags masked in YAFFS_TRACE_ALWAYS are always traced.
+ */
+
+#define YAFFS_TRACE_OS                 0x00000002
+#define YAFFS_TRACE_ALLOCATE           0x00000004
+#define YAFFS_TRACE_SCAN               0x00000008
+#define YAFFS_TRACE_BAD_BLOCKS         0x00000010
+#define YAFFS_TRACE_ERASE              0x00000020
+#define YAFFS_TRACE_GC                 0x00000040
+#define YAFFS_TRACE_WRITE              0x00000080
+#define YAFFS_TRACE_TRACING            0x00000100
+#define YAFFS_TRACE_DELETION           0x00000200
+#define YAFFS_TRACE_BUFFERS            0x00000400
+#define YAFFS_TRACE_NANDACCESS         0x00000800
+#define YAFFS_TRACE_GC_DETAIL          0x00001000
+#define YAFFS_TRACE_SCAN_DEBUG         0x00002000
+#define YAFFS_TRACE_MTD                        0x00004000
+#define YAFFS_TRACE_CHECKPOINT         0x00008000
+
+#define YAFFS_TRACE_VERIFY             0x00010000
+#define YAFFS_TRACE_VERIFY_NAND                0x00020000
+#define YAFFS_TRACE_VERIFY_FULL                0x00040000
+#define YAFFS_TRACE_VERIFY_ALL         0x000F0000
+
+#define YAFFS_TRACE_SYNC               0x00100000
+
+#define YAFFS_TRACE_ERROR              0x40000000
+#define YAFFS_TRACE_BUG                        0x80000000
+#define YAFFS_TRACE_ALWAYS             0xF0000000
+
+
+#define T(mask, p) do { if ((mask) & (yaffs_traceMask | YAFFS_TRACE_ALWAYS)) TOUT(p); } while (0)
+
+#endif
index 1967cb10cef9048777814c000461a5dbb7442bb6..e1f61f49fab59c2b85e64f49b65ebd0f7fbc36a3 100644 (file)
 
 #endif
 
-/* see yaffs_fs.c */
-extern unsigned int yaffs_traceMask;
-extern unsigned int yaffs_wr_attempts;
-
-/*
- * Tracing flags.
- * The flags masked in YAFFS_TRACE_ALWAYS are always traced.
- */
-
-#define YAFFS_TRACE_OS                 0x00000002
-#define YAFFS_TRACE_ALLOCATE           0x00000004
-#define YAFFS_TRACE_SCAN               0x00000008
-#define YAFFS_TRACE_BAD_BLOCKS         0x00000010
-#define YAFFS_TRACE_ERASE              0x00000020
-#define YAFFS_TRACE_GC                 0x00000040
-#define YAFFS_TRACE_WRITE              0x00000080
-#define YAFFS_TRACE_TRACING            0x00000100
-#define YAFFS_TRACE_DELETION           0x00000200
-#define YAFFS_TRACE_BUFFERS            0x00000400
-#define YAFFS_TRACE_NANDACCESS         0x00000800
-#define YAFFS_TRACE_GC_DETAIL          0x00001000
-#define YAFFS_TRACE_SCAN_DEBUG         0x00002000
-#define YAFFS_TRACE_MTD                        0x00004000
-#define YAFFS_TRACE_CHECKPOINT         0x00008000
-
-#define YAFFS_TRACE_VERIFY             0x00010000
-#define YAFFS_TRACE_VERIFY_NAND                0x00020000
-#define YAFFS_TRACE_VERIFY_FULL                0x00040000
-#define YAFFS_TRACE_VERIFY_ALL         0x000F0000
-
-
-#define YAFFS_TRACE_ERROR              0x40000000
-#define YAFFS_TRACE_BUG                        0x80000000
-#define YAFFS_TRACE_ALWAYS             0xF0000000
-
-
-#define T(mask, p) do { if ((mask) & (yaffs_traceMask | YAFFS_TRACE_ALWAYS)) TOUT(p); } while (0)
 
 #ifndef YBUG
 #define YBUG() do {T(YAFFS_TRACE_BUG, (TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR), __LINE__)); } while (0)