Skip to content

Commit

Permalink
sparse: Fix build with 20.05 DPDK tracepoints.
Browse files Browse the repository at this point in the history
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.marchand@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
  • Loading branch information
david-marchand authored and istokes committed May 27, 2020
1 parent c97352e commit 579b643
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/sparse/automake.mk
Expand Up @@ -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 \
Expand Down
26 changes: 26 additions & 0 deletions 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>

0 comments on commit 579b643

Please sign in to comment.