<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 30, 2018 at 11:08 PM, Dengke Du <span dir="ltr">&lt;<a href="mailto:dengke.du@windriver.com" target="_blank">dengke.du@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Dengke Du &lt;<a href="mailto:dengke.du@windriver.com">dengke.du@windriver.com</a>&gt;<br>
---<br>
<span class=""> meta/recipes-kernel/linux/<wbr>files/run-ptest  Â  Â | 138 ++++++++++++++++++++++++++<br></span></blockquote><div><br></div><div>Nothing else in linux-yocto uses &quot;files&quot;, and this shouldn&#39;t either.</div><div><br></div><div>We can&#39;t guarantee that these are version independent, so they need to be in  a versioned</div><div>kernel subdirectory.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
 meta/recipes-kernel/linux/<wbr>linux-yocto.inc  Â  Â |  Â 8 ++<br>
 meta/recipes-kernel/linux/<a href="http://linux-yocto_4.14.bb" rel="noreferrer" target="_blank">linu<wbr>x-yocto_4.14.bb</a> |  Â 2 +-<br>
 3 files changed, 147 insertions(+), 1 deletion(-)<br>
 create mode 100644 meta/recipes-kernel/linux/<wbr>files/run-ptest<br>
<br>
</span>diff --git a/meta/recipes-kernel/linux/<wbr>files/run-ptest b/meta/recipes-kernel/linux/<wbr>files/run-ptest<br>
new file mode 100644<br>
index 0000000..a3d9e14<br>
--- /dev/null<br>
+++ b/meta/recipes-kernel/linux/<wbr>files/run-ptest<br>
@@ -0,0 +1,138 @@<br>
+#!/bin/bash<br></blockquote><div><br></div><div>This script should have a license and proper header file.</div><div><br></div><div>Also, if the ptests are mainly trace/sample related, name the script to indicate that.</div><div><br></div><div>The kernel already has a significant number of selftests, which are likely better than</div><div>these ptests. Is there any reason why they aren&#39;t being used instead ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+depmod<br>
+touch kernel.log<br>
+<br>
+#dma-example bytestream-example inttype-example record-example<br>
+list1=(&quot;dma-example&quot; &quot;bytestream-example&quot; &quot;inttype-example&quot; &quot;record-example&quot;)<br>
+for i in &quot;${list1[@]}&quot;<br>
+do<br>
+  dmesg -c<br>
+  modprobe &quot;$i&quot;<br>
+  result=&quot;&quot;<br>
+  IFS=&quot;-&quot; read -ra array &lt;&lt;&lt; &quot;$i&quot;<br>
+  len=${#array[@]}<br>
+  if [ $len -eq 2 ];then<br>
+  Â  result=&quot;${array[0]}_${array[1]<wbr>}&quot;<br>
+  elif [ $len -eq 3 ];then<br>
+  Â  result=&quot;${array[0]}_${array[1]<wbr>}_${array[2]}&quot;<br>
+  fi<br>
+  lsmod | grep -q &quot;$result&quot;<br>
+  if [ $? -eq 0 ];then<br>
+  Â  dmesg | grep &quot;test passed&quot;<br>
+  Â  if [ $? -eq 0 ];then<br>
+  Â  Â  echo &quot;$i: PASS&quot; &gt;&gt; kernel.log<br>
+  Â  fi<br>
+  Â  rmmod &quot;$i&quot;<br>
+  else<br>
+  Â  echo &quot;$i: FAILED&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+done<br>
+<br>
+#kobject-example kset-example<br>
+list2=(&quot;kobject-example&quot; &quot;kset-example&quot;)<br>
+for i in &quot;${list2[@]}&quot;<br>
+do<br>
+  dmesg -c<br>
+  modprobe &quot;$i&quot;<br>
+  result=&quot;&quot;<br>
+  IFS=&quot;-&quot; read -ra array &lt;&lt;&lt; &quot;$i&quot;<br>
+  len=${#array[@]}<br>
+  if [ $len -eq 2 ];then<br>
+  Â  result=&quot;${array[0]}_${array[1]<wbr>}&quot;<br>
+  elif [ $len -eq 3 ];then<br>
+  Â  result=&quot;${array[0]}_${array[1]<wbr>}_${array[2]}&quot;<br>
+  fi<br>
+  basedir=&quot;/sys/kernel/${result}<wbr>&quot;<br>
+  echo &quot;$basedir&quot;<br>
+  if [ -e ${basedir}/bar -a -e ${basedir}/baz -a -e ${basedir}/foo ];then<br>
+  Â  echo &quot;$i: PASS&quot; &gt;&gt; kernel.log<br>
+  Â  rmmod &quot;$i&quot;<br>
+  else<br>
+  Â  echo &quot;$i: FAILED&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+done<br>
+<br>
+#trace-events-sample<br>
+list3=&quot;trace-events-sample&quot;<br>
+result=&quot;&quot;<br>
+IFS=&quot;-&quot; read -ra array &lt;&lt;&lt; &quot;$list3&quot;<br>
+len=${#array[@]}<br>
+if [ $len -eq 2 ];then<br>
+  result=&quot;${array[0]}_${array[1]<wbr>}&quot;<br>
+elif [ $len -eq 3 ];then<br>
+  result=&quot;${array[0]}_${array[1]<wbr>}_${array[2]}&quot;<br>
+fi<br>
+modprobe &quot;$list3&quot;<br>
+lsmod | grep &quot;$result&quot;<br>
+if [ $? -eq 0 ];then<br>
+  if [ -e &quot;/sys/kernel/debug/tracing/<wbr>events/sample-trace&quot; ];then<br>
+  Â  echo 1 &gt; /sys/kernel/debug/tracing/<wbr>events/sample-trace/enable<br>
+  Â  sleep 5<br>
+  Â  ret=`cat /sys/kernel/debug/tracing/<wbr>trace | grep hello | head -n1 | cut -d&#39;:&#39; -f2`<br>
+  Â  if [ &quot;$ret&quot; = &quot; foo_bar&quot; ];then<br>
+  Â  Â  echo &quot;$list3: PASS&quot;  &gt;&gt; kernel.log<br>
+  Â  else<br>
+  Â  Â  echo &quot;$list3: FAILED-&quot; &gt;&gt; kernel.log<br>
+  Â  fi<br>
+  else<br>
+  Â  echo &quot;$list3: FAILED--&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+else<br>
+  echo &quot;$list3: FAILED---&quot; &gt;&gt; kernel.log<br>
+fi<br>
+rmmod &quot;$list3&quot;<br>
+<br>
+#trace-printk<br>
+list4=&quot;trace-printk&quot;<br>
+modprobe &quot;$list4&quot;<br>
+lsmod | grep &quot;trace_printk&quot;<br>
+if [ $? -eq 0 ];then<br>
+  ret=`cat /sys/kernel/debug/tracing/<wbr>trace | grep trace_printk | head -n1 | cut -d&#39;:&#39; -f2`<br>
+  if [ &quot;$ret&quot; = &quot; trace_printk_irq_work&quot; ];then<br>
+  Â  echo &quot;$list4: PASS&quot; &gt;&gt; kernel.log<br>
+  Â  rmmod &quot;$list4&quot;<br>
+  else<br>
+  Â  echo &quot;$list4: FAILED&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+else<br>
+  echo &quot;$list4: FAILED&quot; &gt;&gt; kernel.log<br>
+fi<br>
+rmmod &quot;$list4&quot;<br>
+<br>
+#kprobe_example<br>
+list5=&quot;kprobe_example&quot;<br>
+dmesg -c<br>
+modprobe &quot;$list5&quot;<br>
+lsmod | grep &quot;$list5&quot;<br>
+if [ $? -eq 0 ];then<br>
+  dmesg | grep &quot;_do_fork&quot;<br>
+  if [ $? -eq 0 ];then<br>
+  Â  echo &quot;$list5: PASS&quot; &gt;&gt; kernel.log<br>
+  else<br>
+  Â  echo &quot;$list5: FAILED&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+else<br>
+  echo &quot;$list5: FAILED&quot; &gt;&gt; kernel.log<br>
+fi<br>
+rmmod &quot;$list5&quot;<br>
+<br>
+#kretprobe_example<br>
+list6=&quot;kretprobe_example&quot;<br>
+dmesg -c<br>
+modprobe &quot;$list6&quot;<br>
+lsmod | grep &quot;$list6&quot;<br>
+if [ $? -eq 0 ];then<br>
+  dmesg | grep &quot;_do_fork returned&quot;<br>
+  if [ $? -eq 0 ];then<br>
+  Â  echo &quot;$list6: PASS&quot; &gt;&gt; kernel.log<br>
+  else<br>
+  Â  echo &quot;$list6: FAILED&quot; &gt;&gt; kernel.log<br>
+  fi<br>
+else<br>
+  echo &quot;$list6: FAILED&quot; &gt;&gt; kernel.log<br>
+fi<br>
+rmmod &quot;$list6&quot;<br>
+<br>
+echo &quot;#####result#####&quot;<br>
+cat kernel.log<br>
+rm kernel.log<br>
diff --git a/meta/recipes-kernel/linux/<wbr>linux-yocto.inc b/meta/recipes-kernel/linux/<wbr>linux-yocto.inc<br>
index 95ec2a2..7e1773e 100644<br>
--- a/meta/recipes-kernel/linux/<wbr>linux-yocto.inc<br>
+++ b/meta/recipes-kernel/linux/<wbr>linux-yocto.inc<br>
@@ -67,3 +67,11 @@ do_install_append(){<br>
 addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile<br>
 addtask validate_branches before do_patch after do_kernel_checkout<br>
 addtask kernel_configcheck after do_configure before do_compile<br>
+<br>
+inherit ptest<br>
+SRC_URI_append = &quot; file://run-ptest \<br>
+&quot;<br>
+do_install_ptest_append() {<br>
+  Â  Â  Â install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest<br>
+}<br>
+KERNEL_FEATURES_append = &quot; ${@bb.utils.contains(&quot;DISTRO_<wbr>FEATURES&quot;, &quot;ptest&quot;, &quot;features/kernel-sample/<wbr>kernel-sample.scc&quot;, &quot;&quot;, d)}&quot;<br>
diff --git a/meta/recipes-kernel/linux/<a href="http://linux-yocto_4.14.bb" rel="noreferrer" target="_blank">li<wbr>nux-yocto_4.14.bb</a> b/meta/recipes-kernel/linux/<a href="http://linux-yocto_4.14.bb" rel="noreferrer" target="_blank">li<wbr>nux-yocto_4.14.bb</a><br>
index 16142f8..7002693 100644<br>
--- a/meta/recipes-kernel/linux/<a href="http://linux-yocto_4.14.bb" rel="noreferrer" target="_blank">li<wbr>nux-yocto_4.14.bb</a><br>
+++ b/meta/recipes-kernel/linux/<a href="http://linux-yocto_4.14.bb" rel="noreferrer" target="_blank">li<wbr>nux-yocto_4.14.bb</a><br>
@@ -19,7 +19,7 @@ SRCREV_machine_qemux86 ?= &quot;<wbr>74f6cd2b6976e37491779fcb1bc496<wbr>6d3a61492c&quot;<br>
 SRCREV_machine_qemux86-64 ?= &quot;<wbr>74f6cd2b6976e37491779fcb1bc496<wbr>6d3a61492c&quot;<br>
 SRCREV_machine_qemumips64 ?= &quot;<wbr>9863b327e770b42b8c18da3e0cfaf0<wbr>6e8f99ae97&quot;<br>
 SRCREV_machine ?= &quot;<wbr>74f6cd2b6976e37491779fcb1bc496<wbr>6d3a61492c&quot;<br>
-SRCREV_meta ?= &quot;<wbr>ea9330894eea727bd1655569b16f33<wbr>8976b72563&quot;<br>
+SRCREV_meta ?= &quot;<wbr>53336e1b7d969f21d8214ec9ceeb48<wbr>fba4f99372&quot;<br></blockquote><div><br></div><div>Do not bump the SRCREV for meta in this series.</div><div><br></div><div>If your feature depends on something in the meta branch (which it does), wait until I&#39;ve sent my next series before sending this.</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 SRC_URI = &quot;git://<a href="http://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}" rel="noreferrer" target="_blank">git.yoctoproject.org/<wbr>linux-yocto.git;name=machine;<wbr>branch=${KBRANCH}</a>; \<br>
  Â  Â  Â  Â  Â  git://<a href="http://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}" rel="noreferrer" target="_blank">git.yoctoproject.org/<wbr>yocto-kernel-cache;type=kmeta;<wbr>name=meta;branch=yocto-4.14;<wbr>destsuffix=${KMETA}</a>&quot;<br>
<div class="HOEnZb"><div class="h5">-- <br>
2.7.4<br>
<br>
-- <br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>