diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-09-08 12:40:48 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-09-08 13:25:31 +0200 |
commit | 709e720caa66816f32c6adc6050549fa40b9cf52 (patch) | |
tree | de2b4e844b0cf65047fec30efb7473f63df39462 /gentree.py | |
parent | 8de4a835ebf57eabe0166cb41d4f61fb52b9fb80 (diff) |
use spatch's built-in concurrency
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-x | gentree.py | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -5,6 +5,7 @@ import argparse, sys, os, errno, shutil, re, subprocess import tarfile, gzip +from multiprocessing import cpu_count # find self source_dir = os.path.abspath(os.path.dirname(__file__)) @@ -584,13 +585,18 @@ def apply_patches(args, desc, source_dir, patch_src, target_dir, logwrite=lambda prefix_len = len(os.path.join(source_dir, patch_src)) + 1 for cocci_file in sempatches: - # Until Coccinelle picks this up - pycocci = os.path.join(source_dir, 'devel/pycocci') - cmd = [pycocci, cocci_file] + cmd = ['spatch', + '--sp-file', cocci_file, + '--in-place', + '--recursive-includes', + '--relax-include-path', + '--use-coccigrep', + '--timeout', '120', + '-j', '%d' % cpu_count(), + '--dir', os.path.abspath(target_dir) ] extra_spatch_args = [] if args.profile_cocci: - cmd.append('--profile-cocci') - cmd.append(os.path.abspath(target_dir)) + cmd.append('--profile') print_name = cocci_file[prefix_len:] if args.verbose: logwrite("Applying SmPL patch %s" % print_name) |