diff options
author | Ruslan Soloviev <r.soloviev@samsung.com> | 2014-12-08 12:10:19 +0300 |
---|---|---|
committer | Dmitry Kovalenko <d.kovalenko@samsung.com> | 2014-12-15 05:26:42 -0800 |
commit | 2a22e591892aab746873054039eb93f64441a780 (patch) | |
tree | 8ec1edf8b30ed74d1a238a67f20600a95fce6a14 | |
parent | 07a96505027716507bc1d69844b9e4b952a1c046 (diff) | |
download | swap-modules-2a22e591892aab746873054039eb93f64441a780.tar.gz swap-modules-2a22e591892aab746873054039eb93f64441a780.tar.bz2 swap-modules-2a22e591892aab746873054039eb93f64441a780.zip |
[REFACTOR] Remove probe counter
Change-Id: Ic4ce08202bf5a0844bd7a5802ac34f2a5263d309
Signed-off-by: Ruslan Soloviev <r.soloviev@samsung.com>
-rw-r--r-- | webprobe/webprobe.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/webprobe/webprobe.c b/webprobe/webprobe.c index d4bc268c..5489aeaa 100644 --- a/webprobe/webprobe.c +++ b/webprobe/webprobe.c @@ -99,33 +99,36 @@ static int ret_web_handler(struct uretprobe_instance *ri, struct pt_regs *regs) return 0; } -#define WEB_FUNC_INSPSERVSTART 0 -#define WEB_FUNC_WILLEXECUTE 1 -#define WEB_FUNC_DIDEXECUTE 2 - static void webprobe_init(struct us_ip *ip) { - static int fcnt = 0; - - switch(fcnt++) { - case WEB_FUNC_INSPSERVSTART: + enum { + web_func_inspservstart, + web_func_willexecute, + web_func_didexecute + }; + static int fnum = web_func_inspservstart; + + /* FIXME: probes can be set more than once */ + switch(fnum) { + case web_func_inspservstart: ip->retprobe.entry_handler = NULL; ip->retprobe.handler = ret_web_handler; + fnum = web_func_willexecute; printk("SWAP_WEBPROBE: web function ewk_view_inspector_server_start\n"); break; - case WEB_FUNC_WILLEXECUTE: + case web_func_willexecute: /* TODO: use uprobe instead of uretprobe */ ip->retprobe.entry_handler = entry_web_handler; ip->retprobe.handler = NULL; + fnum = web_func_didexecute; printk("SWAP_WEBPROBE: web function willExecute\n"); break; - case WEB_FUNC_DIDEXECUTE: + case web_func_didexecute: /* TODO: use uprobe instead of uretprobe */ ip->retprobe.entry_handler = exit_web_handler; ip->retprobe.handler = NULL; + fnum = web_func_inspservstart; printk("SWAP_WEBPROBE: web function didExecute\n"); - /* FIXME: probes can be set more than once */ - fcnt = 0; break; default: printk("SWAP_WEBPROBE: web functions more than necessary\n"); |