mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 12:44:33 +02:00
vfs: use ccomp timer in performance test
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
set(srcdirs ".")
|
idf_component_register(SRC_DIRS "."
|
||||||
|
|
||||||
idf_component_register(SRC_DIRS ${srcdirs}
|
|
||||||
INCLUDE_DIRS .
|
INCLUDE_DIRS .
|
||||||
REQUIRES unity test_utils vfs fatfs spiffs
|
REQUIRES unity test_utils vfs fatfs spiffs)
|
||||||
LDFRAGMENTS linker.lf
|
|
||||||
)
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
|
COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
|
||||||
|
|
||||||
COMPONENT_ADD_LDFRAGMENTS += linker.lf
|
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
[mapping:vfs]
|
|
||||||
archive: libvfs.a
|
|
||||||
entries:
|
|
||||||
vfs:esp_vfs_open (noflash)
|
|
||||||
vfs:esp_vfs_write (noflash)
|
|
||||||
vfs:esp_vfs_close (noflash)
|
|
||||||
vfs:get_vfs_for_fd (noflash)
|
|
||||||
vfs:get_vfs_for_path (noflash)
|
|
||||||
vfs:translate_path (noflash)
|
|
@@ -24,6 +24,7 @@
|
|||||||
#include "unity.h"
|
#include "unity.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "test_utils.h"
|
#include "test_utils.h"
|
||||||
|
#include "ccomp_timer.h"
|
||||||
|
|
||||||
#define VFS_PREF1 "/vfs1"
|
#define VFS_PREF1 "/vfs1"
|
||||||
#define VFS_PREF2 "/vfs2"
|
#define VFS_PREF2 "/vfs2"
|
||||||
@@ -243,7 +244,7 @@ TEST_CASE("Open & write & close through VFS passes performance test", "[vfs]")
|
|||||||
|
|
||||||
TEST_ESP_OK( esp_vfs_register(VFS_PREF1, &desc, NULL) );
|
TEST_ESP_OK( esp_vfs_register(VFS_PREF1, &desc, NULL) );
|
||||||
|
|
||||||
const int64_t begin = esp_timer_get_time();
|
ccomp_timer_start();
|
||||||
const int iter_count = 5000;
|
const int iter_count = 5000;
|
||||||
|
|
||||||
for (int i = 0; i < iter_count; ++i) {
|
for (int i = 0; i < iter_count; ++i) {
|
||||||
@@ -255,9 +256,7 @@ TEST_CASE("Open & write & close through VFS passes performance test", "[vfs]")
|
|||||||
TEST_ASSERT_NOT_EQUAL(close(fd), -1);
|
TEST_ASSERT_NOT_EQUAL(close(fd), -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// esp_vfs_open, esp_vfs_write and esp_vfs_close need to be in IRAM for performance test to pass
|
const int64_t time_diff_us = ccomp_timer_stop();
|
||||||
|
|
||||||
const int64_t time_diff_us = esp_timer_get_time() - begin;
|
|
||||||
const int ns_per_iter = (int) (time_diff_us * 1000 / iter_count);
|
const int ns_per_iter = (int) (time_diff_us * 1000 / iter_count);
|
||||||
TEST_ESP_OK( esp_vfs_unregister(VFS_PREF1) );
|
TEST_ESP_OK( esp_vfs_unregister(VFS_PREF1) );
|
||||||
#ifdef CONFIG_SPIRAM
|
#ifdef CONFIG_SPIRAM
|
||||||
|
Reference in New Issue
Block a user