mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2024-12-29 00:17:49 +00:00
700ee44545
To find any files with a missing copyright declaration, use the following script: # ======================== #!/bin/sh # Find files with copyright declarations, and list their file extensions exts=$(grep -Ril --exclude-dir .git --exclude-dir 3rdparty\ --exclude-dir programs/fuzz 'Copyright.*Arm' | sed ' s/.*\/// s/.*\./*./ s/.*/-name "&"/ ' | sort -u | sed -n ' :l N $!bl s/\n/ -o /gp ') # Find files with file extensions that ususally include copyright extensions, # but don't include a copyright declaration themselves. eval "find\ '(' -path './.git' -o -path './3rdparty' -o -path './programs/fuzz' ')' -prune\ -o ! -path './tests/data_files/format_pkcs12.fmt'\ ! -path './programs/psa/psa_constant_names_generated.c'\ '(' $exts ')' -print" | xargs grep -Li 'Copyright.*Arm' # ======================== Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
38 lines
865 B
Perl
Executable File
38 lines
865 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
# Parse a massif.out.xxx file and output peak total memory usage
|
|
#
|
|
# Copyright (C) 2014, Arm Limited, All Rights Reserved
|
|
#
|
|
# This file is part of Mbed TLS (https://tls.mbed.org)
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
use utf8;
|
|
use open qw(:std utf8);
|
|
|
|
die unless @ARGV == 1;
|
|
|
|
my @snaps;
|
|
open my $fh, '<', $ARGV[0] or die;
|
|
{ local $/ = 'snapshot='; @snaps = <$fh>; }
|
|
close $fh or die;
|
|
|
|
my ($max, $max_heap, $max_he, $max_stack) = (0, 0, 0, 0);
|
|
for (@snaps)
|
|
{
|
|
my ($heap, $heap_extra, $stack) = m{
|
|
mem_heap_B=(\d+)\n
|
|
mem_heap_extra_B=(\d+)\n
|
|
mem_stacks_B=(\d+)
|
|
}xm;
|
|
next unless defined $heap;
|
|
my $total = $heap + $heap_extra + $stack;
|
|
if( $total > $max ) {
|
|
($max, $max_heap, $max_he, $max_stack) = ($total, $heap, $heap_extra, $stack);
|
|
}
|
|
}
|
|
|
|
printf "$max (heap $max_heap+$max_he, stack $max_stack)\n";
|