瀏覽代碼

tools/dev/checker: add script to check pthread calls

Nathalie Furmento 8 年之前
父節點
當前提交
73170033cd
共有 1 個文件被更改,包括 31 次插入0 次删除
  1. 31 0
      tools/dev/checker/starpu_check_pthread.sh

+ 31 - 0
tools/dev/checker/starpu_check_pthread.sh

@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+# StarPU --- Runtime system for heterogeneous multicore architectures.
+#
+# Copyright (C) 2017 CNRS
+#
+# StarPU is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or (at
+# your option) any later version.
+#
+# StarPU is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# See the GNU Lesser General Public License in COPYING.LGPL for more details.
+
+dirname=$(dirname $0)
+sgrep="grep --exclude-dir=.svn --exclude-dir=.git --binary-files=without-match"
+
+macros=$(grep define $dirname/../../../include/starpu_thread_util.h | grep "define STARPU" | awk -F'(' '{print $1}' |awk '{print $2}')
+for m in $macros
+do
+    func=$(echo $m | tr '[A-Z]' '[a-z]')
+    echo processing $func
+    pthread=$(echo $func | sed 's/starpu_//')
+    $sgrep -rsl $func
+    echo
+    $sgrep -rs $pthread | grep -v $func
+    read
+done