xiaoxiang781216 commented on code in PR #3706:
URL: https://github.com/apache/nuttx-apps/pull/3706#discussion_r3789196372
##########
testing/libc/arch_libc/arch_libc_bench.c:
##########
@@ -397,6 +445,14 @@ int arch_libc_bench(void)
return 1;
}
+ if (!bench_pick_clock())
Review Comment:
move before line 438 and remove line 451-452
##########
testing/libc/arch_libc/arch_libc_bench.c:
##########
@@ -0,0 +1,424 @@
+/****************************************************************************
+ * apps/testing/libc/arch_libc/arch_libc_bench.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/* Throughput for the string and memory functions a machine directory may
+ * override, across a size sweep and every source/destination alignment
+ * pair. A machine implementation usually takes its wide path only when
+ * the pointers satisfy some alignment condition, so a single aligned size
+ * reports the best case and hides what the rest of the input space costs.
+ *
+ * Each measurement reports MB/s, which compares across machines, and
+ * cycles per byte from perf_gettime(), which does not depend on the
+ * timebase being calibrated. Both come from one timed loop.
+ *
+ * Two ways a benchmark of these functions measures nothing are defeated
+ * here: the compiler treating a pure call with unchanged arguments as loop
+ * invariant, countered by laundering the pointers through an asm that
+ * claims to change them, and comparison inputs an earlier measurement
+ * scribbled on, countered by preparing the buffers before each timed loop.
+ */
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <nuttx/clock.h>
+
+#ifdef CONFIG_TESTING_ARCH_LIBC_BENCH
Review Comment:
remove the check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]