diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-18 10:28:37 -0500 |
commit | 65d2918e716afb89359cfa59734d76c1ff8700cb (patch) | |
tree | 4685404f96642243d62c3a1a823340913d087090 /scripts | |
parent | bf40e5561fd288a505d5d8d8bf45eef96fe7253d (diff) | |
parent | 338d00cfef07d74a072f96821c64b20f98517d72 (diff) |
Merge branch 'cleanups'
Merge cleanups requested by Linus.
* cleanups: (3 commits)
pnfs: Refactor the *_layout_mark_request_commit to use pnfs_layout_mark_request_commit
nfs: Can call nfs_clear_page_commit() instead
nfs: Provide and use helper functions for marking a page as unstable
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 5 | ||||
-rw-r--r-- | scripts/asn1_compiler.c | 30 | ||||
-rwxr-xr-x | scripts/recordmcount.pl | 10 |
3 files changed, 29 insertions, 16 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 649ce6844033..01df30af4d4a 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -234,8 +234,9 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH | |||
234 | "$(if $(part-of-module),1,0)" "$(@)"; | 234 | "$(if $(part-of-module),1,0)" "$(@)"; |
235 | recordmcount_source := $(srctree)/scripts/recordmcount.pl | 235 | recordmcount_source := $(srctree)/scripts/recordmcount.pl |
236 | endif | 236 | endif |
237 | cmd_record_mcount = \ | 237 | cmd_record_mcount = \ |
238 | if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then \ | 238 | if [ "$(findstring $(CC_FLAGS_FTRACE),$(_c_flags))" = \ |
239 | "$(CC_FLAGS_FTRACE)" ]; then \ | ||
239 | $(sub_cmd_record_mcount) \ | 240 | $(sub_cmd_record_mcount) \ |
240 | fi; | 241 | fi; |
241 | endif | 242 | endif |
diff --git a/scripts/asn1_compiler.c b/scripts/asn1_compiler.c index 91c4117637ae..7750e9c31483 100644 --- a/scripts/asn1_compiler.c +++ b/scripts/asn1_compiler.c | |||
@@ -311,6 +311,9 @@ struct token { | |||
311 | 311 | ||
312 | static struct token *token_list; | 312 | static struct token *token_list; |
313 | static unsigned nr_tokens; | 313 | static unsigned nr_tokens; |
314 | static _Bool verbose; | ||
315 | |||
316 | #define debug(fmt, ...) do { if (verbose) printf(fmt, ## __VA_ARGS__); } while (0) | ||
314 | 317 | ||
315 | static int directive_compare(const void *_key, const void *_pdir) | 318 | static int directive_compare(const void *_key, const void *_pdir) |
316 | { | 319 | { |
@@ -322,21 +325,21 @@ static int directive_compare(const void *_key, const void *_pdir) | |||
322 | dlen = strlen(dir); | 325 | dlen = strlen(dir); |
323 | clen = (dlen < token->size) ? dlen : token->size; | 326 | clen = (dlen < token->size) ? dlen : token->size; |
324 | 327 | ||
325 | //printf("cmp(%*.*s,%s) = ", | 328 | //debug("cmp(%*.*s,%s) = ", |
326 | // (int)token->size, (int)token->size, token->value, | 329 | // (int)token->size, (int)token->size, token->value, |
327 | // dir); | 330 | // dir); |
328 | 331 | ||
329 | val = memcmp(token->value, dir, clen); | 332 | val = memcmp(token->value, dir, clen); |
330 | if (val != 0) { | 333 | if (val != 0) { |
331 | //printf("%d [cmp]\n", val); | 334 | //debug("%d [cmp]\n", val); |
332 | return val; | 335 | return val; |
333 | } | 336 | } |
334 | 337 | ||
335 | if (dlen == token->size) { | 338 | if (dlen == token->size) { |
336 | //printf("0\n"); | 339 | //debug("0\n"); |
337 | return 0; | 340 | return 0; |
338 | } | 341 | } |
339 | //printf("%d\n", (int)dlen - (int)token->size); | 342 | //debug("%d\n", (int)dlen - (int)token->size); |
340 | return dlen - token->size; /* shorter -> negative */ | 343 | return dlen - token->size; /* shorter -> negative */ |
341 | } | 344 | } |
342 | 345 | ||
@@ -515,13 +518,13 @@ static void tokenise(char *buffer, char *end) | |||
515 | } | 518 | } |
516 | 519 | ||
517 | nr_tokens = tix; | 520 | nr_tokens = tix; |
518 | printf("Extracted %u tokens\n", nr_tokens); | 521 | debug("Extracted %u tokens\n", nr_tokens); |
519 | 522 | ||
520 | #if 0 | 523 | #if 0 |
521 | { | 524 | { |
522 | int n; | 525 | int n; |
523 | for (n = 0; n < nr_tokens; n++) | 526 | for (n = 0; n < nr_tokens; n++) |
524 | printf("Token %3u: '%*.*s'\n", | 527 | debug("Token %3u: '%*.*s'\n", |
525 | n, | 528 | n, |
526 | (int)token_list[n].size, (int)token_list[n].size, | 529 | (int)token_list[n].size, (int)token_list[n].size, |
527 | token_list[n].value); | 530 | token_list[n].value); |
@@ -542,6 +545,7 @@ int main(int argc, char **argv) | |||
542 | ssize_t readlen; | 545 | ssize_t readlen; |
543 | FILE *out, *hdr; | 546 | FILE *out, *hdr; |
544 | char *buffer, *p; | 547 | char *buffer, *p; |
548 | char *kbuild_verbose; | ||
545 | int fd; | 549 | int fd; |
546 | 550 | ||
547 | if (argc != 4) { | 551 | if (argc != 4) { |
@@ -550,6 +554,10 @@ int main(int argc, char **argv) | |||
550 | exit(2); | 554 | exit(2); |
551 | } | 555 | } |
552 | 556 | ||
557 | kbuild_verbose = getenv("KBUILD_VERBOSE"); | ||
558 | if (kbuild_verbose) | ||
559 | verbose = atoi(kbuild_verbose); | ||
560 | |||
553 | filename = argv[1]; | 561 | filename = argv[1]; |
554 | outputname = argv[2]; | 562 | outputname = argv[2]; |
555 | headername = argv[3]; | 563 | headername = argv[3]; |
@@ -748,11 +756,11 @@ static void build_type_list(void) | |||
748 | 756 | ||
749 | qsort(type_index, nr, sizeof(type_index[0]), type_index_compare); | 757 | qsort(type_index, nr, sizeof(type_index[0]), type_index_compare); |
750 | 758 | ||
751 | printf("Extracted %u types\n", nr_types); | 759 | debug("Extracted %u types\n", nr_types); |
752 | #if 0 | 760 | #if 0 |
753 | for (n = 0; n < nr_types; n++) { | 761 | for (n = 0; n < nr_types; n++) { |
754 | struct type *type = type_index[n]; | 762 | struct type *type = type_index[n]; |
755 | printf("- %*.*s\n", | 763 | debug("- %*.*s\n", |
756 | (int)type->name->size, | 764 | (int)type->name->size, |
757 | (int)type->name->size, | 765 | (int)type->name->size, |
758 | type->name->value); | 766 | type->name->value); |
@@ -793,7 +801,7 @@ static void parse(void) | |||
793 | 801 | ||
794 | } while (type++, !(type->flags & TYPE_STOP_MARKER)); | 802 | } while (type++, !(type->flags & TYPE_STOP_MARKER)); |
795 | 803 | ||
796 | printf("Extracted %u actions\n", nr_actions); | 804 | debug("Extracted %u actions\n", nr_actions); |
797 | } | 805 | } |
798 | 806 | ||
799 | static struct element *element_list; | 807 | static struct element *element_list; |
@@ -1284,7 +1292,7 @@ static void render(FILE *out, FILE *hdr) | |||
1284 | } | 1292 | } |
1285 | 1293 | ||
1286 | /* We do two passes - the first one calculates all the offsets */ | 1294 | /* We do two passes - the first one calculates all the offsets */ |
1287 | printf("Pass 1\n"); | 1295 | debug("Pass 1\n"); |
1288 | nr_entries = 0; | 1296 | nr_entries = 0; |
1289 | root = &type_list[0]; | 1297 | root = &type_list[0]; |
1290 | render_element(NULL, root->element, NULL); | 1298 | render_element(NULL, root->element, NULL); |
@@ -1295,7 +1303,7 @@ static void render(FILE *out, FILE *hdr) | |||
1295 | e->flags &= ~ELEMENT_RENDERED; | 1303 | e->flags &= ~ELEMENT_RENDERED; |
1296 | 1304 | ||
1297 | /* And then we actually render */ | 1305 | /* And then we actually render */ |
1298 | printf("Pass 2\n"); | 1306 | debug("Pass 2\n"); |
1299 | fprintf(out, "\n"); | 1307 | fprintf(out, "\n"); |
1300 | fprintf(out, "static const unsigned char %s_machine[] = {\n", | 1308 | fprintf(out, "static const unsigned char %s_machine[] = {\n", |
1301 | grammar_name); | 1309 | grammar_name); |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 56ea99a12ab7..826470d7f000 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -242,8 +242,13 @@ if ($arch eq "x86_64") { | |||
242 | $cc .= " -m32"; | 242 | $cc .= " -m32"; |
243 | 243 | ||
244 | } elsif ($arch eq "s390" && $bits == 64) { | 244 | } elsif ($arch eq "s390" && $bits == 64) { |
245 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; | 245 | if ($cc =~ /-DCC_USING_HOTPATCH/) { |
246 | $mcount_adjust = -14; | 246 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*brcl\\s*0,[0-9a-f]+ <([^\+]*)>\$"; |
247 | $mcount_adjust = 0; | ||
248 | } else { | ||
249 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; | ||
250 | $mcount_adjust = -14; | ||
251 | } | ||
247 | $alignment = 8; | 252 | $alignment = 8; |
248 | $type = ".quad"; | 253 | $type = ".quad"; |
249 | $ld .= " -m elf64_s390"; | 254 | $ld .= " -m elf64_s390"; |
@@ -255,7 +260,6 @@ if ($arch eq "x86_64") { | |||
255 | # force flags for this arch | 260 | # force flags for this arch |
256 | $ld .= " -m shlelf_linux"; | 261 | $ld .= " -m shlelf_linux"; |
257 | $objcopy .= " -O elf32-sh-linux"; | 262 | $objcopy .= " -O elf32-sh-linux"; |
258 | $cc .= " -m32"; | ||
259 | 263 | ||
260 | } elsif ($arch eq "powerpc") { | 264 | } elsif ($arch eq "powerpc") { |
261 | $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; | 265 | $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; |