Received: by 10.223.164.221 with SMTP id h29csp2332383wrb; Thu, 2 Nov 2017 09:16:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QhqN13grPw5N032yP76N38ZbHcv+IbQXPluH+NvqZvgI8Z9R25sPxX82BShh6iP5+pH8SO X-Received: by 10.98.89.82 with SMTP id n79mr4345206pfb.133.1509639368491; Thu, 02 Nov 2017 09:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509639368; cv=none; d=google.com; s=arc-20160816; b=J6xeLI91Q31Nb84v7SSnqAeo5lMpAo6rxAU4rZ5KwwyefS9s/swv+EmfcJVxdEX8iw 10avksC3V1ikH32P4rddeH2JyV7iuf6nnalb73qKszvk7qfGOJ+mH1uyV6rq+OS28Nwh 75uJ5Lnh7tquyL4OHqcQ8eDxqLTDbaALnFfjUweJBXyZoi826FtD7uZTMAuSQWgRQE9Q mW0weAPphl0fqVLjmRD+rGMpKA9EGgahb629IEUcZY0fomcrAlVgdO/NZk/7gHajaPk0 Pv24cCeaItdTi6yBGc1U+qH2Yph/PQf2HNUZu4lkhIbTVQ9COR3CkWCwV/MXPCP3jXnS QrBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=YmvKBZjqeigUh/OGaPVcnn5gwgvV5tSyvy9IwcybTY4=; b=rvA88oxHs93ViQzC3yjESrFVJy3hTOUPL2v0OQu03dPAYzgs7ja58ZReQHc2KyqlE7 WxTvNBs2cinMUzEvzOXTc8LRx1Z5kF2IjZAFwVG3Gw06oC+Xg0eXTz3xjAYVOlLQGJI1 uWxLn1uXWoxzELuSnv9OU9xAS/7y6Fd5L/5h49EZp8ac70HbzOQDXxftNEFNzKpS1CWH LDn5L+Os1CuR5n6b27ezi3WmWQX3wIi50iIQa6G0BxEmrDKUwTFZfdMtQ852YASuqroJ 5TziYyF3vxJ2jFGxd1j4tZlZ6/yy4kI/WWLnvVgo/wNUDX4NdUonLTvsV7+j/mqS1Oj5 tThA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PV88phVq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3929908pgo.346.2017.11.02.09.15.53; Thu, 02 Nov 2017 09:16:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PV88phVq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934113AbdKBQPT (ORCPT + 97 others); Thu, 2 Nov 2017 12:15:19 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45749 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932971AbdKBQPR (ORCPT ); Thu, 2 Nov 2017 12:15:17 -0400 Received: by mail-lf0-f65.google.com with SMTP id n69so82700lfn.2; Thu, 02 Nov 2017 09:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YmvKBZjqeigUh/OGaPVcnn5gwgvV5tSyvy9IwcybTY4=; b=PV88phVqlXd2/xu2ZiSous7FMjvuwMvc+jE6GrC9pF4TQU9pzkOM9WcqWLwGuHgr8H jiGZ2JXBHoTXjJwmVJRpzE55xCDXWRaHH5tQkx95UjbqXCTXOeUWcn5fc3lmwa8I8Azi r4CVDM4KAIBDKQuZHJ0XDQgXBes8DTM+8aXag53IXBD9MmFlcKvnzIWzqJ52xt2MISV7 NUvWYWKZRdoXH4uQ+P5HGb/+c/u0a58XO96VaBbbdI7xc4BBl4OKc/NARx7gLFUfzMjh MrSnXdN/0nB5Ya7WNL+eN7CVEH0u3U/N61scoifWdJrJ2UJWh6usPh/o276W0ppeCZC1 dyZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YmvKBZjqeigUh/OGaPVcnn5gwgvV5tSyvy9IwcybTY4=; b=EuGTyzFaYlEpBGT5dTuafa0pPh0H+sEPl5fA2LlCfuWM6+DSDeMtJgrrw2L+o4yloF oEkjO9+8gf2xACzmCv4nAn3sXoHyo1YIculB+RHOIDsbt5NngPnl0bGvMoRGaHVCUpV1 z1QzLgyzimyxdru90LbiYMEkGhOziwQ3NaL/3l3p0cbmfNUM9HTzSYMlCsIhJtYssFT9 gUfcDXU3Pl2rysNOFDo+73HR3yLhr94oiqJAPEHHHvW0fuiFkVWmogTPJUSVp+6mV42q L5pbBW7+XRjMQXKcmKJCcPFCHUwMtZkhxSGWPsy29LmgHOVlhE0bCc09CFmh5Dte9URO y1NA== X-Gm-Message-State: AMCzsaVVxMFjVZSMPZJ9t7+Z+e9JBQ5+NunQkRMugAXlJv/+jPMMHRX5 wVhNodPiFcgYG1xpMWldlk7qSNFdRmyLnjvNvYg= X-Received: by 10.46.16.155 with SMTP id 27mr1512043ljq.169.1509639315910; Thu, 02 Nov 2017 09:15:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.167.79 with HTTP; Thu, 2 Nov 2017 09:15:15 -0700 (PDT) In-Reply-To: <014ae05d-0404-10de-bcc8-7d18f441566a@kernel.org> References: <1508801195-5369-1-git-send-email-pintu.ping@gmail.com> <1509555639-26128-1-git-send-email-pintu.ping@gmail.com> <014ae05d-0404-10de-bcc8-7d18f441566a@kernel.org> From: Pintu Kumar Date: Thu, 2 Nov 2017 21:45:15 +0530 Message-ID: Subject: Re: [PATCHv5 1/1] [tools/selftests]: android/ion: userspace test utility for ion buffer sharing To: shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Laura Abbott , Greg Kroah-Hartman , dvhart@infradead.org, Bamvor Zhang Jian , Pintu Kumar , Shuah Khan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 2, 2017 at 8:37 PM, Shuah Khan wrote: > Hi Pintu, > > On 11/01/2017 11:00 AM, Pintu Agarwal wrote: >> This is a test utility to verify ION buffer sharing in user space >> between 2 independent processes. >> It uses unix domain socket (with SCM_RIGHTS) as IPC to transfer an FD to >> another process to share the same buffer. >> This utility demonstrates how ION buffer sharing can be implemented between >> two user space processes, using various heap types. >> >> This utility is made to be run as part of kselftest framework in kernel. >> The utility is verified on Ubuntu-32 bit system with Linux Kernel 4.14, >> using ION system heap. >> >> For more information about the utility please check the README file. >> >> Signed-off-by: Pintu Agarwal >> --- >> tools/testing/selftests/Makefile | 3 +- >> tools/testing/selftests/android/Makefile | 46 ++++ >> tools/testing/selftests/android/ion/.gitignore | 2 + >> tools/testing/selftests/android/ion/Makefile | 16 ++ >> tools/testing/selftests/android/ion/README | 101 ++++++++ >> tools/testing/selftests/android/ion/config | 4 + >> tools/testing/selftests/android/ion/ion.h | 143 ++++++++++++ >> tools/testing/selftests/android/ion/ion_test.sh | 55 +++++ >> .../testing/selftests/android/ion/ionapp_export.c | 135 +++++++++++ >> .../testing/selftests/android/ion/ionapp_import.c | 88 +++++++ >> tools/testing/selftests/android/ion/ionutils.c | 259 +++++++++++++++++++++ >> tools/testing/selftests/android/ion/ionutils.h | 55 +++++ >> tools/testing/selftests/android/ion/ipcsocket.c | 227 ++++++++++++++++++ >> tools/testing/selftests/android/ion/ipcsocket.h | 35 +++ >> tools/testing/selftests/android/run.sh | 3 + >> 15 files changed, 1171 insertions(+), 1 deletion(-) >> create mode 100644 tools/testing/selftests/android/Makefile >> create mode 100644 tools/testing/selftests/android/ion/.gitignore >> create mode 100644 tools/testing/selftests/android/ion/Makefile >> create mode 100644 tools/testing/selftests/android/ion/README >> create mode 100644 tools/testing/selftests/android/ion/config >> create mode 100644 tools/testing/selftests/android/ion/ion.h >> create mode 100755 tools/testing/selftests/android/ion/ion_test.sh >> create mode 100644 tools/testing/selftests/android/ion/ionapp_export.c >> create mode 100644 tools/testing/selftests/android/ion/ionapp_import.c >> create mode 100644 tools/testing/selftests/android/ion/ionutils.c >> create mode 100644 tools/testing/selftests/android/ion/ionutils.h >> create mode 100644 tools/testing/selftests/android/ion/ipcsocket.c >> create mode 100644 tools/testing/selftests/android/ion/ipcsocket.h >> create mode 100755 tools/testing/selftests/android/run.sh >> >> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile >> index ff80564..61bc77b 100644 >> --- a/tools/testing/selftests/Makefile >> +++ b/tools/testing/selftests/Makefile >> @@ -1,4 +1,5 @@ >> -TARGETS = bpf >> +TARGETS = android > > Based on our discussion on dependency on staging headers, let's not add > this test to kselftest run. Remove it from here and users can run it > as needed. > >> +TARGETS += bpf >> TARGETS += breakpoints >> TARGETS += capabilities >> TARGETS += cpufreq >> diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefil> new file mode 100644 >> index 0000000..1a74922 >> --- /dev/null >> +++ b/tools/testing/selftests/android/Makefile >> @@ -0,0 +1,46 @@ >> +SUBDIRS := ion >> + >> +TEST_PROGS := run.sh >> + >> +.PHONY: all clean >> + >> +include ../lib.mk >> + >> +all: >> + @for DIR in $(SUBDIRS); do \ >> + BUILD_TARGET=$(OUTPUT)/$$DIR; \ >> + mkdir $$BUILD_TARGET -p; \ >> + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ >> + #SUBDIR test prog name should be in the form: SUBDIR_test.sh >> + TEST=$$DIR"_test.sh"; \ >> + if [ -e $$DIR/$$TEST ]; then >> + rsync -a $$DIR/$$TEST $$BUILD_TARGET/; >> + fi >> + done >> + >> +override define RUN_TESTS >> + @cd $(OUTPUT); ./run.sh >> +endef >> + >> +override define INSTALL_RULE >> + mkdir -p $(INSTALL_PATH) >> + install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) >> + >> + @for SUBDIR in $(SUBDIRS); do \ >> + BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \ >> + mkdir $$BUILD_TARGET -p; \ >> + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ >> + done; >> +endef >> + >> +override define EMIT_TESTS >> + echo "./run.sh" >> +endef >> + >> +override define CLEAN >> + @for DIR in $(SUBDIRS); do \ >> + BUILD_TARGET=$(OUTPUT)/$$DIR; \ >> + mkdir $$BUILD_TARGET -p; \ >> + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ >> + done >> +endef > > This Makefile is fine, you still want to leverage common run_tests target > in lib.mk Install and emit tests should be fine, because these are built > in the source tree. I am looking to avoid attempts to build this test > outside kernel tree. Ok, I understood what you mean. You want to remove ion test from kselftest build, but still maintain the test code inside selftest. Yes, I agree with this, kselftest will succeed (outside of kernel source tree), and still somebody can build and run it locally. But, my concern is, whole this recent patches were made to include it into kselftest framework. Otherwise in my previous patch, I included it under: tools/testing/android (outside of selftest). If, removing the android/ion from kselftest is fine (as of now), I can push the new changes by tomorrow. Just waiting for Greg and Laura to confirm... Thanks, Pintu > > thanks, > -- Shuah From 1582967409765516238@xxx Thu Nov 02 15:09:22 +0000 2017 X-GM-THRID: 1579656416160844925 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread