Skip to content

Commit

Permalink
ocfs2: Remove ENTRY from masklog.
Browse files Browse the repository at this point in the history
ENTRY is used to record the entry of a function.
But because it is added in so many functions, if we enable it,
the system logs get filled up quickly and cause too much I/O.
So actually no one can open it for a production system or even
for a test.

So for mlog_entry_void, we just remove it.
for mlog_entry(...), we replace it with mlog(0,...), and they
will be replace by trace event later.

Signed-off-by: Tao Ma <[email protected]>
  • Loading branch information
taoma-tm committed Feb 21, 2011
1 parent 422e6c4 commit ef6b689
Show file tree
Hide file tree
Showing 31 changed files with 161 additions and 418 deletions.
28 changes: 2 additions & 26 deletions fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,6 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
struct buffer_head *eb_bh = NULL;
u64 last_eb_blk = 0;

mlog_entry_void();

el = et->et_root_el;
last_eb_blk = ocfs2_et_get_last_eb_blk(et);

Expand Down Expand Up @@ -1010,8 +1008,6 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle,
OCFS2_SB(ocfs2_metadata_cache_get_super(et->et_ci));
struct ocfs2_extent_block *eb;

mlog_entry_void();

count = 0;
while (count < wanted) {
status = ocfs2_claim_metadata(handle,
Expand Down Expand Up @@ -1173,8 +1169,6 @@ static int ocfs2_add_branch(handle_t *handle,
struct ocfs2_extent_list *el;
u32 new_cpos, root_end;

mlog_entry_void();

BUG_ON(!last_eb_bh || !*last_eb_bh);

if (eb_bh) {
Expand Down Expand Up @@ -1353,8 +1347,6 @@ static int ocfs2_shift_tree_depth(handle_t *handle,
struct ocfs2_extent_list *root_el;
struct ocfs2_extent_list *eb_el;

mlog_entry_void();

status = ocfs2_create_new_meta_bhs(handle, et, 1, meta_ac,
&new_eb_bh);
if (status < 0) {
Expand Down Expand Up @@ -1446,8 +1438,6 @@ static int ocfs2_find_branch_target(struct ocfs2_extent_tree *et,
struct buffer_head *bh = NULL;
struct buffer_head *lowest_bh = NULL;

mlog_entry_void();

*target_bh = NULL;

el = et->et_root_el;
Expand Down Expand Up @@ -5795,8 +5785,8 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb,
struct ocfs2_dinode *di;
struct ocfs2_truncate_log *tl;

mlog_entry("start_blk = %llu, num_clusters = %u\n",
(unsigned long long)start_blk, num_clusters);
mlog(0, "start_blk = %llu, num_clusters = %u\n",
(unsigned long long)start_blk, num_clusters);

BUG_ON(mutex_trylock(&tl_inode->i_mutex));

Expand Down Expand Up @@ -5878,8 +5868,6 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
struct inode *tl_inode = osb->osb_tl_inode;
struct buffer_head *tl_bh = osb->osb_tl_bh;

mlog_entry_void();

di = (struct ocfs2_dinode *) tl_bh->b_data;
tl = &di->id2.i_dealloc;
i = le16_to_cpu(tl->tl_used) - 1;
Expand Down Expand Up @@ -5949,8 +5937,6 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb)
struct ocfs2_dinode *di;
struct ocfs2_truncate_log *tl;

mlog_entry_void();

BUG_ON(mutex_trylock(&tl_inode->i_mutex));

di = (struct ocfs2_dinode *) tl_bh->b_data;
Expand Down Expand Up @@ -6032,8 +6018,6 @@ static void ocfs2_truncate_log_worker(struct work_struct *work)
container_of(work, struct ocfs2_super,
osb_truncate_log_wq.work);

mlog_entry_void();

status = ocfs2_flush_truncate_log(osb);
if (status < 0)
mlog_errno(status);
Expand Down Expand Up @@ -6174,8 +6158,6 @@ int ocfs2_complete_truncate_log_recovery(struct ocfs2_super *osb,
struct inode *tl_inode = osb->osb_tl_inode;
struct ocfs2_truncate_log *tl;

mlog_entry_void();

if (OCFS2_I(tl_inode)->ip_blkno == le64_to_cpu(tl_copy->i_blkno)) {
mlog(ML_ERROR, "Asked to recover my own truncate log!\n");
return -EINVAL;
Expand Down Expand Up @@ -6228,8 +6210,6 @@ void ocfs2_truncate_log_shutdown(struct ocfs2_super *osb)
int status;
struct inode *tl_inode = osb->osb_tl_inode;

mlog_entry_void();

if (tl_inode) {
cancel_delayed_work(&osb->osb_truncate_log_wq);
flush_workqueue(ocfs2_wq);
Expand All @@ -6251,8 +6231,6 @@ int ocfs2_truncate_log_init(struct ocfs2_super *osb)
struct inode *tl_inode = NULL;
struct buffer_head *tl_bh = NULL;

mlog_entry_void();

status = ocfs2_get_truncate_log_info(osb,
osb->slot_num,
&tl_inode,
Expand Down Expand Up @@ -7005,8 +6983,6 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
struct ocfs2_extent_tree et;
struct ocfs2_cached_dealloc_ctxt dealloc;

mlog_entry_void();

ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode), di_bh);
ocfs2_init_dealloc_ctxt(&dealloc);

Expand Down
16 changes: 7 additions & 9 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
void *kaddr;

mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);
mlog(0, "(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);

BUG_ON(ocfs2_inode_is_fast_symlink(inode));

Expand Down Expand Up @@ -136,8 +136,8 @@ int ocfs2_get_block(struct inode *inode, sector_t iblock,
u64 p_blkno, count, past_eof;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);

mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);
mlog(0, "(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);

if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SYSTEM_FILE)
mlog(ML_NOTICE, "get_block on system inode 0x%p (%lu)\n",
Expand Down Expand Up @@ -278,7 +278,7 @@ static int ocfs2_readpage(struct file *file, struct page *page)
loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT;
int ret, unlock = 1;

mlog_entry("(0x%p, %lu)\n", file, (page ? page->index : 0));
mlog(0, "(0x%p, %lu)\n", file, (page ? page->index : 0));

ret = ocfs2_inode_lock_with_page(inode, NULL, 0, page);
if (ret != 0) {
Expand Down Expand Up @@ -398,7 +398,7 @@ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc)
{
int ret;

mlog_entry("(0x%p)\n", page);
mlog(0, "(0x%p)\n", page);

ret = block_write_full_page(page, ocfs2_get_block, wbc);

Expand Down Expand Up @@ -450,7 +450,7 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
int err = 0;
struct inode *inode = mapping->host;

mlog_entry("(block = %llu)\n", (unsigned long long)block);
mlog(0, "(block = %llu)\n", (unsigned long long)block);

/* We don't need to lock journal system files, since they aren't
* accessed concurrently from multiple nodes.
Expand Down Expand Up @@ -618,8 +618,6 @@ static ssize_t ocfs2_direct_IO(int rw,
struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host;
int ret;

mlog_entry_void();

/*
* Fallback to buffered I/O if we see an inode without
* extents.
Expand Down
10 changes: 4 additions & 6 deletions fs/ocfs2/buffer_head_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ int ocfs2_write_block(struct ocfs2_super *osb, struct buffer_head *bh,
{
int ret = 0;

mlog_entry("(bh->b_blocknr = %llu, ci=%p)\n",
(unsigned long long)bh->b_blocknr, ci);
mlog(0, "(bh->b_blocknr = %llu, ci=%p)\n",
(unsigned long long)bh->b_blocknr, ci);

BUG_ON(bh->b_blocknr < OCFS2_SUPER_BLOCK_BLKNO);
BUG_ON(buffer_jbd(bh));
Expand Down Expand Up @@ -186,8 +186,8 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
struct buffer_head *bh;
struct super_block *sb = ocfs2_metadata_cache_get_super(ci);

mlog_entry("(ci=%p, block=(%llu), nr=(%d), flags=%d)\n",
ci, (unsigned long long)block, nr, flags);
mlog(0, "(ci=%p, block=(%llu), nr=(%d), flags=%d)\n",
ci, (unsigned long long)block, nr, flags);

BUG_ON(!ci);
BUG_ON((flags & OCFS2_BH_READAHEAD) &&
Expand Down Expand Up @@ -408,8 +408,6 @@ int ocfs2_write_super_or_backup(struct ocfs2_super *osb,
int ret = 0;
struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;

mlog_entry_void();

BUG_ON(buffer_jbd(bh));
ocfs2_check_super_or_backup(osb->sb, bh->b_blocknr);

Expand Down
2 changes: 0 additions & 2 deletions fs/ocfs2/cluster/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,8 +1658,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
struct o2hb_disk_slot *slot;
struct o2hb_disk_heartbeat_block *hb_block;

mlog_entry_void();

ret = o2hb_read_slots(reg, reg->hr_blocks);
if (ret) {
mlog_errno(ret);
Expand Down
1 change: 0 additions & 1 deletion fs/ocfs2/cluster/masklog.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ struct mlog_attribute {
}

static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask(ENTRY),
define_mask(EXIT),
define_mask(TCP),
define_mask(MSG),
Expand Down
13 changes: 1 addition & 12 deletions fs/ocfs2/cluster/masklog.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@

/* bits that are frequently given and infrequently matched in the low word */
/* NOTE: If you add a flag, you need to also update masklog.c! */
#define ML_ENTRY 0x0000000000000001ULL /* func call entry */
#define ML_EXIT 0x0000000000000002ULL /* func call exit */
#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */
#define ML_MSG 0x0000000000000008ULL /* net network messages */
Expand Down Expand Up @@ -124,7 +123,7 @@
#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */

#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
#define MLOG_INITIAL_NOT_MASK (ML_ENTRY|ML_EXIT)
#define MLOG_INITIAL_NOT_MASK (ML_EXIT)
#ifndef MLOG_MASK_PREFIX
#define MLOG_MASK_PREFIX 0
#endif
Expand Down Expand Up @@ -223,14 +222,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
} while (0)

#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define mlog_entry(fmt, args...) do { \
mlog(ML_ENTRY, "ENTRY:" fmt , ##args); \
} while (0)

#define mlog_entry_void() do { \
mlog(ML_ENTRY, "ENTRY:\n"); \
} while (0)

/*
* We disable this for sparse.
*/
Expand Down Expand Up @@ -267,8 +258,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
mlog(ML_EXIT, "EXIT\n"); \
} while (0)
#else
#define mlog_entry(...) do { } while (0)
#define mlog_entry_void(...) do { } while (0)
#define mlog_exit(...) do { } while (0)
#define mlog_exit_ptr(...) do { } while (0)
#define mlog_exit_void(...) do { } while (0)
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static int ocfs2_dentry_revalidate(struct dentry *dentry,
inode = dentry->d_inode;
osb = OCFS2_SB(dentry->d_sb);

mlog_entry("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
mlog(0, "(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);

/* For a negative dentry -
* check the generation number of the parent and compare with the
Expand Down
20 changes: 5 additions & 15 deletions fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh,
int de_len;
int ret = 0;

mlog_entry_void();

de_buf = first_de;
dlimit = de_buf + bytes;

Expand Down Expand Up @@ -706,8 +704,6 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
int num = 0;
int nblocks, i, err;

mlog_entry_void();

sb = dir->i_sb;

nblocks = i_size_read(dir) >> sb->s_blocksize_bits;
Expand Down Expand Up @@ -1166,7 +1162,7 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
int i, status = -ENOENT;
ocfs2_journal_access_func access = ocfs2_journal_access_db;

mlog_entry("(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
mlog(0, "(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);

if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
access = ocfs2_journal_access_di;
Expand Down Expand Up @@ -1632,8 +1628,6 @@ int __ocfs2_add_entry(handle_t *handle,
struct buffer_head *insert_bh = lookup->dl_leaf_bh;
char *data_start = insert_bh->b_data;

mlog_entry_void();

if (!namelen)
return -EINVAL;

Expand Down Expand Up @@ -2028,8 +2022,8 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
struct inode *inode = filp->f_path.dentry->d_inode;
int lock_level = 0;

mlog_entry("dirino=%llu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno);
mlog(0, "dirino=%llu\n",
(unsigned long long)OCFS2_I(inode)->ip_blkno);

error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
if (lock_level && error >= 0) {
Expand Down Expand Up @@ -2114,8 +2108,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
int ret;
struct ocfs2_dir_lookup_result lookup = { NULL, };

mlog_entry("dir %llu, name '%.*s'\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
mlog(0, "dir %llu, name '%.*s'\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);

ret = -EEXIST;
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0)
Expand Down Expand Up @@ -2324,8 +2318,6 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
struct buffer_head *new_bh = NULL;
struct ocfs2_dir_entry *de;

mlog_entry_void();

if (ocfs2_new_dir_wants_trailer(inode))
size = ocfs2_dir_trailer_blk_off(parent->i_sb);

Expand Down Expand Up @@ -3270,8 +3262,6 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
struct ocfs2_extent_tree et;
struct buffer_head *dx_root_bh = lookup->dl_dx_root_bh;

mlog_entry_void();

if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
/*
* This would be a code error as an inline directory should
Expand Down
6 changes: 3 additions & 3 deletions fs/ocfs2/dlm/dlmconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm,

assert_spin_locked(&res->spinlock);

mlog_entry("type=%d, convert_type=%d, new convert_type=%d\n",
lock->ml.type, lock->ml.convert_type, type);
mlog(0, "type=%d, convert_type=%d, new convert_type=%d\n",
lock->ml.type, lock->ml.convert_type, type);

spin_lock(&lock->spinlock);

Expand Down Expand Up @@ -353,7 +353,7 @@ static enum dlm_status dlm_send_remote_convert_request(struct dlm_ctxt *dlm,
struct kvec vec[2];
size_t veclen = 1;

mlog_entry("%.*s\n", res->lockname.len, res->lockname.name);
mlog(0, "%.*s\n", res->lockname.len, res->lockname.name);

memset(&convert, 0, sizeof(struct dlm_convert_lock));
convert.node_idx = dlm->node_num;
Expand Down
Loading

0 comments on commit ef6b689

Please sign in to comment.