diff options
author | Vitaliy Cherepanov <v.cherepanov@samsung.com> | 2014-09-17 17:18:25 +0400 |
---|---|---|
committer | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2014-09-25 00:23:06 -0700 |
commit | 9c2cba05ab9c74717005a0bc1356698c2b1bc93f (patch) | |
tree | ca0b6920966948c0be177494565602f14cfd7431 | |
parent | c86a139dcaf04c242b5022e3ae6fbee9f32ff842 (diff) | |
download | swap-modules-9c2cba05ab9c74717005a0bc1356698c2b1bc93f.tar.gz swap-modules-9c2cba05ab9c74717005a0bc1356698c2b1bc93f.tar.bz2 swap-modules-9c2cba05ab9c74717005a0bc1356698c2b1bc93f.zip |
[PROTO] redesign lock handler events. add new subtype
id event
14: lock_ack_start
15: lock_ack_end
16: lock_release
Change-Id: I375df27b13b36c82a8e4db67e11c76ee0c8c1f51
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
-rw-r--r-- | ks_features/file_ops.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ks_features/file_ops.c b/ks_features/file_ops.c index 500d01e9..dfc64d08 100644 --- a/ks_features/file_ops.c +++ b/ks_features/file_ops.c @@ -37,8 +37,9 @@ enum { FOPS_RECV = 10, FOPS_OPTION = 11, FOPS_MANAGE = 12, - FOPS_LOCK = 14, /* 13 */ - FOPS_UNLOCK = 15 + FOPS_LOCK_START = 14, /* 13 */ + FOPS_LOCK_END = 15, + FOPS_LOCK_RELEASE = 16 }; struct file_probe { @@ -565,8 +566,8 @@ static int lock_entry_handler(struct kretprobe_instance *ri, filepath = fops_fpath(file, buf, PATH_LEN); if (lock_arg_init(fprobe->id, regs, &arg) == 0) { - subtype = (arg.type == F_UNLCK ? FOPS_UNLOCK: - FOPS_LOCK); + subtype = (arg.type == F_UNLCK ? FOPS_LOCK_RELEASE: + FOPS_LOCK_START); custom_entry_event(F_ADDR(rp), regs, PT_FILE, subtype, "Sxddxx", @@ -598,9 +599,16 @@ static int lock_ret_handler(struct kretprobe_instance *ri, struct kretprobe *rp = ri->rp; struct flock_private *priv = (struct flock_private *)ri->data; - if (rp && priv->dentry) + if (rp && priv->dentry) { + int subtype; + if (priv->subtype == FOPS_LOCK_START) + subtype = FOPS_LOCK_END; /* lock ret marked as lock_end */ + else + subtype = priv->subtype; + custom_exit_event(F_ADDR(rp), R_ADDR(ri), regs, - PT_FILE, priv->subtype, "x"); + PT_FILE, subtype, "x"); + } return 0; } |