From: Martin Hořeňovský Date: Wed, 21 Aug 2013 18:27:18 +0000 (+0200) Subject: Integrates cpu loading library and adds some minor changes. X-Git-Tag: fix-allnoconfig~153 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/892bd75ffefedb5fdf4de47bbdaa97071e4f0909?ds=sidebyside Integrates cpu loading library and adds some minor changes. Changes include changes to makefiles, new commands for shell (start_load, stop_load), and new convenience script for iterating while working on the gateway. --- diff --git a/rtems/gw/Makefile.omk b/rtems/gw/Makefile.omk index 7a584f3..efc9929 100644 --- a/rtems/gw/Makefile.omk +++ b/rtems/gw/Makefile.omk @@ -1,2 +1,2 @@ -SUBDIRS = system_opt cangw +SUBDIRS = system_opt cangw libs diff --git a/rtems/gw/cangw/Makefile.omk b/rtems/gw/cangw/Makefile.omk index abea9eb..eeef8e4 100644 --- a/rtems/gw/cangw/Makefile.omk +++ b/rtems/gw/cangw/Makefile.omk @@ -3,9 +3,6 @@ default_CONFIG += CONFIG_OC_GDBSTUB=n bin_PROGRAMS = cangw -#lib_LIBRARIES = - -#include_HEADERS = #I am not entirely sure these two are needed, but according to documentation, they are. CFLAGS_LD += HeapSize=0x80000 @@ -13,3 +10,7 @@ MANAGERS = io event semaphore cangw_SOURCES += init.c gw.c helpers.c +lib_LOADLIBES += load + +#lib_LIBRARIES +#include_HEADERS diff --git a/rtems/gw/cangw/gw.c b/rtems/gw/cangw/gw.c index 2e56fb4..24d4087 100644 --- a/rtems/gw/cangw/gw.c +++ b/rtems/gw/cangw/gw.c @@ -51,7 +51,7 @@ static void fd_closer(void* arg){ * This function implements the main thread loop and enough decision logic so that it knows which device to take messages from and which device to send the messages to. * */ -void* CAN_GW_thread(void* arg){ +static void* CAN_GW_thread(void* arg){ int fd_in, fd_out; int res; unsigned long int *total, *succ, *err; diff --git a/rtems/gw/cangw/gw.h b/rtems/gw/cangw/gw.h index 3a61f30..742ab1a 100644 --- a/rtems/gw/cangw/gw.h +++ b/rtems/gw/cangw/gw.h @@ -1,6 +1,8 @@ #ifndef __GW_H_ #define __GW_H_ +extern unsigned long int total_1, total_2, succ_1, succ_2, err_1, err_2; + int start_GW(); int end_GW(); diff --git a/rtems/gw/cangw/helpers.c b/rtems/gw/cangw/helpers.c index 117c469..c5f9022 100644 --- a/rtems/gw/cangw/helpers.c +++ b/rtems/gw/cangw/helpers.c @@ -13,15 +13,14 @@ #include #include - #include "helpers.h" #include "gw.h" +#include "load.h" #include #include "networkconfig.h" -extern unsigned long int total_1, total_2, succ_1, succ_2, err_1, err_2; static rtems_device_major_number mscan_major; static rtems_driver_address_table mscan_driver_table=MSCAN_DRIVER_TABLE_ENTRY; @@ -96,8 +95,6 @@ int show_net(int argc, char** argv){ rtems_bsdnet_show_if_stats(); rtems_bsdnet_show_ip_stats(); rtems_bsdnet_show_icmp_stats(); - rtems_bsdnet_show_tcp_stats(); - rtems_bsdnet_show_udp_stats(); rtems_bsdnet_show_mbuf_stats(); rtems_bsdnet_show_inet_routes(); return 0; @@ -112,7 +109,15 @@ int start_net(int argc, char** argv){ return 1; } printf("Success\n"); - printf("About to show routes.\n"); + printf("Found routes.\n"); rtems_bsdnet_show_inet_routes (); return 0; -} \ No newline at end of file +} + +int start_load(int argc, char** argv){ + return start_thread_load(); +} + +int stop_load(int argc, char** argv){ + return end_thread_load(); +} diff --git a/rtems/gw/cangw/helpers.h b/rtems/gw/cangw/helpers.h index efda330..2705078 100644 --- a/rtems/gw/cangw/helpers.h +++ b/rtems/gw/cangw/helpers.h @@ -7,5 +7,7 @@ int print_regs(int argc, char** argv); int print_can_totals(int argc, char** argv); int start_net(int argc, char** argv); int show_net(int argc, char** argv); +int start_load(int argc, char** argv); +int stop_load(int argc, char** argv); #endif \ No newline at end of file diff --git a/rtems/gw/cangw/init.c b/rtems/gw/cangw/init.c index 63e00ea..2398a87 100644 --- a/rtems/gw/cangw/init.c +++ b/rtems/gw/cangw/init.c @@ -101,6 +101,14 @@ rtems_task Init(rtems_task_argument ignored){ rtems_shell_add_cmd("showNET", "app", "prints some diagnostic info from network adapter/driver", show_net); + + rtems_shell_add_cmd("start_load", "app", + "starts loading threads", + start_load); + + rtems_shell_add_cmd("stop_load", "app", + "stops loading threads", + stop_load); status = rtems_task_delete( RTEMS_SELF ); diff --git a/rtems/gw/config.omk-default b/rtems/gw/config.omk-default index 33d23fa..05d2c9a 100644 --- a/rtems/gw/config.omk-default +++ b/rtems/gw/config.omk-default @@ -3,8 +3,8 @@ # Overrides should be stored in file config.omk # Config for system_opt -# Config for libbar -# Config for appfoo +# Config for cangw CONFIG_OC_BUILD4RTEMS=y CONFIG_OC_GDBSTUB=n +# Config for libs # Config for diff --git a/rtems/gw/iterate b/rtems/gw/iterate new file mode 100755 index 0000000..4185f59 --- /dev/null +++ b/rtems/gw/iterate @@ -0,0 +1,3 @@ +#!/bin/sh + +make && ./mkimg-ppc-cangw && ~/can-benchmark/scripts/restart