When building against 20.05-rc1 which introduced a tracing framework, mempool header now triggers an error with sparse.
.../dpdk-dir/build/include/rte_mempool_trace_fp.h:96:1: error: undefined identifier '__atomic_load_n' .../dpdk-dir/build/include/rte_mempool_trace_fp.h:57:1: error: undefined identifier '__atomic_load_n' .../dpdk-dir/build/include/rte_mempool_trace_fp.h:47:1: error: undefined identifier '__atomic_load_n' .../dpdk-dir/build/include/rte_mempool_trace_fp.h:38:1: error: undefined identifier '__atomic_load_n' .../dpdk-dir/build/include/rte_mempool_trace_fp.h:38:1: error: not a function <noident> .../dpdk-dir/build/include/rte_mempool_trace_fp.h:38:1: error: undefined identifier '__ATOMIC_ACQUIRE' .../dpdk-dir/build/include/rte_mempool_trace_fp.h:96:1: error: not a function <noident> Wrap around the gcc atomic builtins used in one of the tracing framework helper. Signed-off-by: David Marchand <david.march...@redhat.com> --- include/sparse/automake.mk | 1 + include/sparse/rte_trace_point_provider.h | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 include/sparse/rte_trace_point_provider.h diff --git a/include/sparse/automake.mk b/include/sparse/automake.mk index 974ad3fe55..49d4513d69 100644 --- a/include/sparse/automake.mk +++ b/include/sparse/automake.mk @@ -12,6 +12,7 @@ noinst_HEADERS += \ include/sparse/pthread.h \ include/sparse/rte_atomic.h \ include/sparse/rte_memcpy.h \ + include/sparse/rte_trace_point_provider.h \ include/sparse/sys/socket.h \ include/sparse/sys/sysmacros.h \ include/sparse/sys/types.h \ diff --git a/include/sparse/rte_trace_point_provider.h b/include/sparse/rte_trace_point_provider.h new file mode 100644 index 0000000000..237fe90d42 --- /dev/null +++ b/include/sparse/rte_trace_point_provider.h @@ -0,0 +1,26 @@ +/* Copyright 2020, Red Hat, Inc. + * + * Licensed 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. + */ + +#ifndef __CHECKER__ +#error "Use this header only with sparse. It is not a correct implementation." +#endif + +/* sparse doesn't know about gcc atomic builtins. */ +#define __ATOMIC_ACQUIRE 0 +#define __atomic_load_n(p, memorder) (*(p)) + +/* Get actual <rte_trace_point_provider.h> definitions for us to annotate and + * build on. */ +#include_next <rte_trace_point_provider.h> -- 2.23.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev