mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Emilio López" <emilio.lopez@collabora.co.uk>, shuah@kernel.org
Cc: devel@driverdev.osuosl.org, gustavo.padovan@collabora.co.uk,
	riandrews@android.com, daniel.vetter@ffwll.ch,
	John.C.Harrison@Intel.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, ghackmann@google.com,
	robdclark@gmail.com, linux-kselftest@vger.kernel.org,
	maarten.lankhorst@linux.intel.com, daniels@collabora.com,
	arve@android.com, emil.l.velikov@gmail.com,
	"Emilio López" <emilio.lopez@collabora.co.uk>
Subject: Re: [PATCH 1/7] selftest: sync: basic tests for sw_sync framework
Date: Thu, 22 Sep 2016 19:43:46 +1000	[thread overview]
Message-ID: <87fuos8e25.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20160921211205.22657-2-emilio.lopez@collabora.co.uk>

Emilio López <emilio.lopez@collabora.co.uk> writes:

> These tests are based on the libsync test suite from Android.
> This commit lays the ground for future tests, as well as includes
> tests for a variety of basic allocation commands.

Hi Emilio,

Just a few comments on the Makefile.

> diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile
> new file mode 100644
> index 0000000..f67827f
> --- /dev/null
> +++ b/tools/testing/selftests/sync/Makefile
> @@ -0,0 +1,24 @@
> +CC = $(CROSS_COMPILE)gcc

lib.mk does that for you.

> +CFLAGS := -O2 -g -std=gnu89 -pthread -Wall -Wextra

It's more polite to just add to CFLAGS rather than defining it from
scratch. That way a user can add CFLAGS via setting them in the
environment.

ie. this would be:

CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra

or:

CFLAGS := -O2 -g -std=gnu89 -pthread -Wall -Wextra $(CFLAGS)


> +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.

> +LDFLAGS += -pthread
> +
> +TEST_PROGS = sync_test
> +
> +all: $(TEST_PROGS)
> +
> +include ../lib.mk
> +
> +SRC = sync_test.o sync.o

SRC would usually point to .c files, .o's would be in OBJS or something
similar. Though it's not that important obviously.

Just listing the .c files in SRC should work, make knows how to turn
them into .o's for you.

> +TESTS += sync_alloc.o

And similarly there.

So I think you could just use:

SRC := sync_test.c sync.c sync_alloc.c

Or if you actually just want to list all the .c files in the directory
then this would also work:

SRC := $(wildcard *.c)

> +sync_test: $(SRC) $(TESTS)
> +
> +.PHONY: clean

lib.mk did that for you.

> +
> +clean:
> +	$(RM) sync_test $(SRC) $(TESTS)

If you redefined SRC above to be the actual sources then you obviously
don't want to clean them, so here you would just use *.o.

cheers

  reply	other threads:[~2016-09-22  9:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 21:11 [PATCH 0/7] Tests for sync infrastructure Emilio López
2016-09-21 21:11 ` [PATCH 1/7] selftest: sync: basic tests for sw_sync framework Emilio López
2016-09-22  9:43   ` Michael Ellerman [this message]
2016-09-22 14:23     ` Emilio López
2016-09-27  4:23       ` Michael Ellerman
2016-09-27 14:51         ` Emilio López
2016-10-05  1:00           ` Michael Ellerman
2016-09-21 21:12 ` [PATCH 2/7] selftest: sync: fence " Emilio López
2016-09-21 21:12 ` [PATCH 3/7] selftest: sync: merge " Emilio López
2016-09-21 21:12 ` [PATCH 4/7] selftest: sync: wait " Emilio López
2016-09-21 21:12 ` [PATCH 5/7] selftest: sync: stress test for parallelism Emilio López
2016-09-21 21:12 ` [PATCH 6/7] selftest: sync: stress consumer/producer test Emilio López
2016-09-21 21:12 ` [PATCH 7/7] selftest: sync: stress test for merges Emilio López
2016-10-19 12:49 ` [PATCH v2 0/7] Tests for sync infrastructure Emilio López
2016-10-19 12:49   ` [PATCH v2 1/7] selftest: sync: basic tests for sw_sync framework Emilio López
2016-11-01 16:18     ` Gustavo Padovan
2016-12-13 16:46       ` Shuah Khan
2016-10-19 12:49   ` [PATCH v2 2/7] selftest: sync: fence " Emilio López
2016-10-19 12:49   ` [PATCH v2 3/7] selftest: sync: merge " Emilio López
2016-10-19 12:49   ` [PATCH v2 4/7] selftest: sync: wait " Emilio López
2016-10-19 12:49   ` [PATCH v2 5/7] selftest: sync: stress test for parallelism Emilio López
2016-10-19 12:49   ` [PATCH v2 6/7] selftest: sync: stress consumer/producer test Emilio López
2016-10-19 12:49   ` [PATCH v2 7/7] selftest: sync: stress test for merges Emilio López
2016-12-02  1:17   ` [PATCH v2 0/7] Tests for sync infrastructure Shuah Khan
2016-12-02 14:08     ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fuos8e25.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=John.C.Harrison@Intel.com \
    --cc=arve@android.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emilio.lopez@collabora.co.uk \
    --cc=ghackmann@google.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=riandrews@android.com \
    --cc=robdclark@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®