add benchmark to app. TODO: test benchmark.

This commit is contained in:
TXuian 2022-12-07 17:56:33 +08:00
parent 7c50a73bf1
commit 99c1582d27
2 changed files with 6 additions and 12 deletions

View File

@ -141,11 +141,12 @@ void *run_benchmark(void *args) {
pthread_t benchmark_task; pthread_t benchmark_task;
static int embenchmark(void) { static int embenchmark(void) {
pthread_attr_t attr; // pthread_attr_t attr;
attr.schedparam.sched_priority = 25; // attr.schedparam.sched_priority = 25;
attr.stacksize = 4096; // attr.stacksize = 4096;
PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); // PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL);
run_benchmark(NULL);
return 0; return 0;
} }
PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR);

View File

@ -10,7 +10,7 @@
* See the Mulan PSL v2 for more details. * See the Mulan PSL v2 for more details.
*/ */
__STACKSIZE__ = 4096; __STACKSIZE__ = 8192;
OUTPUT_ARCH( "riscv" ) OUTPUT_ARCH( "riscv" )
MEMORY MEMORY
{ {
@ -41,13 +41,6 @@ SECTIONS
_shell_command_end = .; _shell_command_end = .;
. = ALIGN(8); . = ALIGN(8);
/* section information for embench */
. = ALIGN(8);
_benchmark_start = .;
KEEP (*(benchmark))
_benchmark_end = .;
. = ALIGN(8);
PROVIDE(__ctors_start__ = .); PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*))) KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array)) KEEP (*(.init_array))