Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488937

Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework

From Emilio López <emilio.lopez@collabora.co.uk>
Newsgroups linux.kernel
Subject Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework
Date 2016-09-22 16:30 +0200
Message-ID <skdaG-7wd-25@gated-at.bofh.it> (permalink)
References <sjX5T-5Jq-9@gated-at.bofh.it> <sjX5T-5Jq-21@gated-at.bofh.it> <sk8NI-4AG-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Michael,

El 22/09/16 a las 06:43, Michael Ellerman escribió:
> Emilio López <emilio.lopez@collabora.co.uk> writes:
>> +CFLAGS += -I../../../../include/uapi/
>
> Please don't include the unprocessed uapi headers, they are not meant to
> be directly included in userspace programs.
>
> They even say so:
>
> include/uapi/linux/types.h:#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
>
>> +CFLAGS += -I../../../../include/
>
> Please don't include the *kernel* headers, they're really not meant to
> be used in userspace programs :)
>
>> +CFLAGS += -I../../../../usr/include/
>
> That is the correct place to get them from. They'll have been put there
> by 'make headers_install'.
>
>> +CFLAGS += -I../../../../drivers/dma-buf/
>
> That's also a bit fishy.

My inspiration here has been tools/testing/selftests/memfd/Makefile, 
which does it this way. If I only include the ones on usr then it 
doesn't build, as there's no sync_file.h available, even after running 
make headers_install. How am I supposed to use the ioctls from there?

The dma-buf include path is a leftover from the previous version, 
there's no longer any headers there. I've fixed the other things you 
pointed out, the new Makefile is below if you want to take another look.

Thanks for the review! :)
Emilio

---

CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
CFLAGS += -I../../../../usr/include/
LDFLAGS += -pthread

TEST_PROGS = sync_test

all: $(TEST_PROGS)

include ../lib.mk

OBJS = sync_test.o sync.o

TESTS += sync_alloc.o
TESTS += sync_fence.o
TESTS += sync_merge.o
TESTS += sync_wait.o
TESTS += sync_stress_parallelism.o
TESTS += sync_stress_consumer.o
TESTS += sync_stress_merge.o

sync_test: $(OBJS) $(TESTS)

clean:
	$(RM) sync_test $(OBJS) $(TESTS)

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] Tests for sync infrastructure Emilio López <emilio.lopez@collabora.co.uk> - 2016-09-21 23:20 +0200
  [PATCH 3/7] selftest: sync: merge tests for sw_sync framework Emilio López <emilio.lopez@collabora.co.uk> - 2016-09-21 23:20 +0200
  [PATCH 5/7] selftest: sync: stress test for parallelism Emilio López <emilio.lopez@collabora.co.uk> - 2016-09-21 23:20 +0200
  [PATCH 1/7] selftest: sync: basic tests for sw_sync framework Emilio López <emilio.lopez@collabora.co.uk> - 2016-09-21 23:20 +0200
    Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework Michael Ellerman <mpe@ellerman.id.au> - 2016-09-22 11:50 +0200
      Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework Emilio López <emilio.lopez@collabora.co.uk> - 2016-09-22 16:30 +0200

csiph-web