Subrata Modak 写道:
> Hi,
> 
> I went through in doing testing around couple of machines and here are
> my observations. First of all i would like it to get it integrated with
> LTP-build, which your patch presently does not provide. In next
> iteration you can include this patch:
> ProcessEventConnectorBuildDefault.patch
> 

Thanks, I will revise the patch.

> 
> Process Event Connector was added from 2.6.15 onwards(Correct me if i am
> wrong). So, i can see that the tests did not build for kernels below
> 2.6.15 (for all architectures i tested, it failed when kernel is below
> 2.6.15). Even for kernels above 2.6.15, it failed for ia64
> (kernel=2.6.16.21-0.8-default). Even though the test built successfully
> for ppc64 and ia64(kernel > 2.6.15), the test-run failed for both.
> Please see the following table for the summary and later for detailed
> output:
> 

Yes, it was 2.6.15. We can prevent building failure by checking the kernel
version, but it seems we have no way to check whether this feature is
compiled into kernel or not, that's why I can't make it run by default.

At best we can check if netlink connector is supported. If it's not supported,
the return value of bind() is ENOENT.

> ===========================================================
> ||Architecture||Kernel||Build||Run||
> ===========================================================
> ||i386||2.6.18-53.1.13.el5||PASSED||PASS(root),FAIL(non-root)||
> ||x86_64||2.6.9-67.ELsmp||FAILED||
> ||x86_64||2.6.18-92.el5||PASSED||PASSED as root-user||
> ||ppc64||2.6.9-67.ELsmp||FAILED||
> ||ppc64||2.6.20-CBE||PASSED||FAILED||
> ||ia64||2.6.16.21-0.8-default||FAILED||
> ||ia64||2.6.23.13||PASSED||FAILED||
> ===========================================================
> 
> Also it seems that the tests should be executed as root. Please document
> them in your README file.
> 

Yes, it can be execuetd as root only. I'll document it and fix the patch.

> So, we have 2 potential problem to solve:
> 1) Prevent building in machines where it is not supported (Criteria can
> be i)kernel 2.6.15 below, ii) Some #define criteria). Please see how
> this is handled in containers test cases:
> http://ltp.cvs.sourceforge.net/ltp/ltp/testcases/kernel/containers/,
> http://ltp.cvs.sourceforge.net/ltp/ltp/testcases/kernel/containers/Makefile,
> http://ltp.cvs.sourceforge.net/ltp/ltp/testcases/kernel/containers/check_for_unshare.c,
> 2) Even if you go ahead and build successfully from the Makefile, you
> can prevent execution through the usage of tst_kvercmp(int r1, int r2,
> int r3) function defined here:
> http://ltp.cvs.sourceforge.net/ltp/ltp/lib/tst_kvercmp.c
> and used here:
> http://ltp.cvs.sourceforge.net/ltp/ltp/testcases/kernel/syscalls/remap_file_pages/remap_file_pages01.c,
> 
> 
> I hope this will help you in re-writing this patch and send it across.
> When everything goes fine, i will include it and also will generate a
> code coverage for the same. Thanks for contributing to LTP. I also found
> a test program written by Matt:
> http://linux.derkeiler.com/pdf/Mailing-Lists/Kernel/2005-09/8369.pdf,
> 

That program is essentially the same with pec_listenner.c in my patch, but it's
somewhat outdated that I'm sure it can't even compile.

> 
> Regards--
> Subrata
> 
> ========================================================================================
> Detailed Output on various Machines:
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.18-53.1.13.el5 #1 SMP Mon Feb 11 13:27:52 EST 2008
> i686 i686 i386 GNU/Linux
> 
> <<<test_start>>>
> tag=Connectors stime=1213260740
> cmdline="run_pec_test"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> incrementing stop
> pec01       1  FAIL  :  failed to listen process events
> pec01       2  FAIL  :  failed to listen process events
> pec01       3  FAIL  :  failed to listen process events
> pec01       4  FAIL  :  failed to listen process events
> pec01       5  FAIL  :  failed to listen process events
> <<<execution_status>>>
> duration=10 termination_type=exited termination_id=1 corefile=no
> cutime=1 cstime=4
> <<<test_end>>>
> 
> [root@<>]#uname -a
> Linux <sniff> 2.6.18-53.1.13.el5 #1 SMP Mon Feb 11 13:27:52 EST 2008
> i686 i686 i386 GNU/Linux
> 
> <<<test_start>>>
> tag=Connectors stime=1213263628
> cmdline="run_pec_test"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> incrementing stop
> pec01       1  PASS  :  get event - fork parent: 7478, child: 7479
> pec01       2  PASS  :  get event - exec pid: 7490
> pec01       3  PASS  :  get event - exit pid: 7500 exit_code: 0
> pec01       4  PASS  :  get event - uid pid: 7510 euid: 99
> pec01       5  PASS  :  get event - gid pid: 7519 egid: 99
> <<<execution_status>>>
> duration=10 termination_type=exited termination_id=0 corefile=no
> cutime=3 cstime=6
> <<<test_end>>>
> ========================================================================================
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.9-67.EL #1 SMP Wed Nov 7 13:50:40 EST 2007 ppc64 ppc64
> ppc64 GNU/Linux
> 
> # uname -a
> Linux <sniff> 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64
> x86_64 x86_64 GNU/Linux
> 
> make[4]: Entering directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors/pec'
> cc -Wall  -I../../../../include -Wall    event_generator.c
> -L../../../../lib -lltp  -o event_generator
> event_generator.c: In function `process_options':
> event_generator.c:154: warning: comparison is always true due to limited
> range of data type
> cc -Wall  -I../../../../include -Wall    pec_listener.c
> -L../../../../lib -lltp  -o pec_listener
> In file included from pec_listener.c:32:
> /usr/include/linux/netlink.h:22: error: syntax error before "__u32"
> /usr/include/linux/netlink.h:28: error: syntax error before "__u32"
> /usr/include/linux/netlink.h:30: error: syntax error before
> "nlmsg_flags"
> /usr/include/linux/netlink.h:31: error: syntax error before "nlmsg_seq"
> /usr/include/linux/netlink.h:32: error: syntax error before "nlmsg_pid"
> /usr/include/linux/netlink.h:82: error: field `msg' has incomplete type
> pec_listener.c:33:29: linux/connector.h: No such file or directory
> pec_listener.c:34:27: linux/cn_proc.h: No such file or directory
> pec_listener.c:41: error: syntax error before "seq"
> pec_listener.c:41: warning: type defaults to `int' in declaration of
> `seq'
> pec_listener.c:41: warning: data definition has no type or storage class
> pec_listener.c:63: warning: "struct cn_msg" declared inside parameter
> list
> pec_listener.c:63: warning: its scope is only this definition or
> declaration, which is probably not what you want
> pec_listener.c: In function `netlink_send':
> pec_listener.c:75: error: dereferencing pointer to incomplete type
> pec_listener.c:76: error: dereferencing pointer to incomplete type
> pec_listener.c:77: error: dereferencing pointer to incomplete type
> pec_listener.c:78: error: dereferencing pointer to incomplete type
> pec_listener.c:78: error: dereferencing pointer to incomplete type
> pec_listener.c:78: error: dereferencing pointer to incomplete type
> pec_listener.c:78: error: invalid application of `sizeof' to incomplete
> type `nlmsghdr' 
> pec_listener.c:79: error: dereferencing pointer to incomplete type
> pec_listener.c:80: error: invalid application of `sizeof' to incomplete
> type `nlmsghdr' 
> pec_listener.c:80: error: dereferencing pointer to incomplete type
> pec_listener.c:80: error: dereferencing pointer to incomplete type
> pec_listener.c:84: error: dereferencing pointer to incomplete type
> pec_listener.c:88: error: dereferencing pointer to incomplete type
> pec_listener.c: In function `netlink_recv':
> pec_listener.c:111: error: invalid application of `sizeof' to incomplete
> type `nlmsghdr' 
> pec_listener.c:116: error: invalid application of `sizeof' to incomplete
> type `nlmsghdr' 
> pec_listener.c:119: error: dereferencing pointer to incomplete type
> pec_listener.c: At top level:
> pec_listener.c:135: warning: "enum proc_cn_mcast_op" declared inside
> parameter list
> pec_listener.c:136: error: parameter `op' has incomplete type
> pec_listener.c: In function `control_pec':
> pec_listener.c:138: error: invalid application of `sizeof' to incomplete
> type `cn_msg' 
> pec_listener.c:138: error: invalid application of `sizeof' to incomplete
> type `proc_cn_mcast_op' 
> pec_listener.c:145: error: dereferencing pointer to incomplete type
> pec_listener.c:145: error: `CN_IDX_PROC' undeclared (first use in this
> function)
> pec_listener.c:145: error: (Each undeclared identifier is reported only
> once
> pec_listener.c:145: error: for each function it appears in.)
> pec_listener.c:146: error: dereferencing pointer to incomplete type
> pec_listener.c:146: error: `CN_VAL_PROC' undeclared (first use in this
> function)
> pec_listener.c:147: error: dereferencing pointer to incomplete type
> pec_listener.c:148: error: dereferencing pointer to incomplete type
> pec_listener.c:149: error: dereferencing pointer to incomplete type
> pec_listener.c:151: error: dereferencing pointer to incomplete type
> pec_listener.c:152: error: dereferencing pointer to incomplete type
> pec_listener.c:154: warning: passing arg 3 of `netlink_send' from
> incompatible pointer type
> pec_listener.c: In function `process_event':
> pec_listener.c:169: error: invalid application of `sizeof' to incomplete
> type `nlmsghdr' 
> pec_listener.c:171: error: dereferencing pointer to incomplete type
> pec_listener.c:173: error: dereferencing pointer to incomplete type
> pec_listener.c:174: error: `PROC_EVENT_NONE' undeclared (first use in
> this function)
> pec_listener.c:175: error: dereferencing pointer to incomplete type
> pec_listener.c:177: error: `PROC_EVENT_FORK' undeclared (first use in
> this function)
> pec_listener.c:179: error: dereferencing pointer to incomplete type
> pec_listener.c:180: error: dereferencing pointer to incomplete type
> pec_listener.c:182: error: `PROC_EVENT_EXEC' undeclared (first use in
> this function)
> pec_listener.c:184: error: dereferencing pointer to incomplete type
> pec_listener.c:186: error: `PROC_EVENT_UID' undeclared (first use in
> this function)
> pec_listener.c:188: error: dereferencing pointer to incomplete type
> pec_listener.c:189: error: dereferencing pointer to incomplete type
> pec_listener.c:190: error: dereferencing pointer to incomplete type
> pec_listener.c:192: error: `PROC_EVENT_GID' undeclared (first use in
> this function)
> pec_listener.c:194: error: dereferencing pointer to incomplete type
> pec_listener.c:195: error: dereferencing pointer to incomplete type
> pec_listener.c:196: error: dereferencing pointer to incomplete type
> pec_listener.c:198: error: `PROC_EVENT_EXIT' undeclared (first use in
> this function)
> pec_listener.c:200: error: dereferencing pointer to incomplete type
> pec_listener.c:201: error: dereferencing pointer to incomplete type
> pec_listener.c:202: error: dereferencing pointer to incomplete type
> pec_listener.c: In function `main':
> pec_listener.c:214: error: storage size of 'l_local' isn't known
> pec_listener.c:215: error: storage size of 'src_addr' isn't known
> pec_listener.c:224: error: `NETLINK_CONNECTOR' undeclared (first use in
> this function)
> pec_listener.c:238: error: `CN_IDX_PROC' undeclared (first use in this
> function)
> pec_listener.c:241: error: invalid application of `sizeof' to incomplete
> type `sockaddr_nl' 
> pec_listener.c:248: error: `PROC_CN_MCAST_LISTEN' undeclared (first use
> in this function)
> pec_listener.c:263: error: `PROC_CN_MCAST_IGNORE' undeclared (first use
> in this function)
> pec_listener.c:282: error: dereferencing pointer to incomplete type
> pec_listener.c:289: error: dereferencing pointer to incomplete type
> pec_listener.c:214: warning: unused variable `l_local'
> pec_listener.c:215: warning: unused variable `src_addr'
> make[4]: *** [pec_listener] Error 1
> make[4]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors/pec'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases'
> make: *** [all] Error 2
> ========================================================================================
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.20-CBE #1 SMP Wed Mar 21 10:24:39 CET 2007 ppc64 ppc64
> ppc64 GNU/Linux
> 
> <<<test_start>>>
> tag=Connectors stime=1213263077
> cmdline="run_pec_test"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> incrementing stop
> unknown option!
> Usage: event_generator -e fork|exit|exec|uid|gid [-n nr_event]
> pec01       1  FAIL  :  failed to generate process events
> unknown option!
> Usage: event_generator -e fork|exit|exec|uid|gid [-n nr_event]
> pec01       2  FAIL  :  failed to generate process events
> unknown option!
> Usage: event_generator -e fork|exit|exec|uid|gid [-n nr_event]
> pec01       3  FAIL  :  failed to generate process events
> unknown option!
> Usage: event_generator -e fork|exit|exec|uid|gid [-n nr_event]
> pec01       4  FAIL  :  failed to generate process events
> unknown option!
> Usage: event_generator -e fork|exit|exec|uid|gid [-n nr_event]
> pec01       5  FAIL  :  failed to generate process events
> <<<execution_status>>>
> duration=10 termination_type=exited termination_id=1 corefile=no
> cutime=3 cstime=8
> <<<test_end>>>
> ========================================================================================
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.16.21-0.8-default #1 SMP Mon Jul 3 18:25:39 UTC 2006
> ia64 ia64 ia64 GNU/Linux
> 
> make[4]: Entering directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors/pec'
> cc -Wall  -I../../../../include -Wall    event_generator.c
> -L../../../../lib -lltp  -o event_generator
> cc -Wall  -I../../../../include -Wall    pec_listener.c
> -L../../../../lib -lltp  -o pec_listener
> In file included from /usr/include/linux/cn_proc.h:29,
>                  from pec_listener.c:34:
> /usr/include/linux/time.h:12: error: redefinition of ‘struct timespec’
> /usr/include/linux/time.h:18: error: redefinition of ‘struct timeval’
> make[4]: *** [pec_listener] Error 1
> make[4]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors/pec'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel/connectors'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases/kernel'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory
> `/root/subrata/ltp/ltp-full-20080531/testcases'
> make: *** [all] Error 2
> ========================================================================================
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64
> x86_64 x86_64 GNU/Linux
> 
> <<<test_start>>>
> tag=Connectors stime=1213264628
> cmdline="run_pec_test"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> incrementing stop
> pec01       1  PASS  :  get event - fork parent: 18993, child: 18994
> pec01       2  PASS  :  get event - exec pid: 19003
> pec01       3  PASS  :  get event - exit pid: 19013 exit_code: 0
> pec01       4  PASS  :  get event - uid pid: 19022 euid: 99
> pec01       5  PASS  :  get event - gid pid: 19031 egid: 99
> <<<execution_status>>>
> duration=10 termination_type=exited termination_id=0 corefile=no
> cutime=2 cstime=4
> <<<test_end>>>
> ========================================================================================
> ========================================================================================
> # uname -a
> Linux <sniff> 2.6.23.13 #1 SMP Wed Jan 9 18:14:28 PST 2008 ia64
> GNU/Linux
> 
> <<<test_start>>>
> tag=Connectors stime=1213267703
> cmdline="run_pec_test"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> incrementing stop
> pec01       1  FAIL  :  failed to listen process events
> pec01       2  FAIL  :  failed to listen process events
> pec01       3  FAIL  :  failed to listen process events
> pec01       4  FAIL  :  failed to listen process events
> pec01       5  FAIL  :  failed to listen process events
> <<<execution_status>>>
> duration=10 termination_type=exited termination_id=1 corefile=no
> cutime=5 cstime=7
> <<<test_end>>>
> ========================================================================================
> ========================================================================================


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to