| .. | .. |
|---|
| 75 | 75 | OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE" |
|---|
| 76 | 76 | fi |
|---|
| 77 | 77 | |
|---|
| 78 | + # Use only one thread per core by default if hyperthreading is enabled |
|---|
| 79 | + THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]") |
|---|
| 78 | 80 | if [ -z "$J" ]; then |
|---|
| 79 | 81 | NPROC=$(getconf _NPROCESSORS_ONLN) |
|---|
| 82 | + if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 4 ] ; then |
|---|
| 83 | + NPROC=$((NPROC/2)) |
|---|
| 84 | + fi |
|---|
| 80 | 85 | else |
|---|
| 81 | 86 | NPROC="$J" |
|---|
| 82 | 87 | fi |
|---|
| .. | .. |
|---|
| 99 | 104 | if [ "$MODE" = "" ] ; then |
|---|
| 100 | 105 | if [ "$ONLINE" = "0" ] ; then |
|---|
| 101 | 106 | echo 'You have not explicitly specified the mode to use. Using default "report" mode.' |
|---|
| 102 | | - echo 'Available modes are the following: patch, report, context, org' |
|---|
| 107 | + echo 'Available modes are the following: patch, report, context, org, chain' |
|---|
| 103 | 108 | echo 'You can specify the mode with "make coccicheck MODE=<mode>"' |
|---|
| 104 | 109 | echo 'Note however that some modes are not implemented by some semantic patches.' |
|---|
| 105 | 110 | fi |
|---|
| .. | .. |
|---|
| 126 | 131 | if [ $VERBOSE -ne 0 ] ; then |
|---|
| 127 | 132 | echo "Running ($NPROC in parallel): $@" |
|---|
| 128 | 133 | fi |
|---|
| 129 | | - echo $@ >>$DEBUG_FILE |
|---|
| 130 | | - $@ 2>>$DEBUG_FILE |
|---|
| 134 | + if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then |
|---|
| 135 | + echo $@>>$DEBUG_FILE |
|---|
| 136 | + $@ 2>>$DEBUG_FILE |
|---|
| 137 | + else |
|---|
| 138 | + echo $@ |
|---|
| 139 | + $@ 2>&1 |
|---|
| 140 | + fi |
|---|
| 141 | + |
|---|
| 131 | 142 | err=$? |
|---|
| 132 | 143 | if [[ $err -ne 0 ]]; then |
|---|
| 133 | 144 | echo "coccicheck failed" |
|---|