From 064b404fcc5d6c1096306543c37b2ad7abc79738 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 14 Sep 2015 18:08:42 +0800 Subject: [PATCH] add script --- scripts/change_dylib_path.pl | 1 - scripts/cpve_log.pl | 33 ++++++++++++++++++++++++++------- scripts/update_cpve.pl | 13 +++---------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/scripts/change_dylib_path.pl b/scripts/change_dylib_path.pl index a615f98..5ab2c9d 100755 --- a/scripts/change_dylib_path.pl +++ b/scripts/change_dylib_path.pl @@ -1,7 +1,6 @@ #!/usr/bin/perl -w # use strict; -use warnings; #use v5.10; my @cpve_libs = ( 'libpme.0.dylib', 'libpmexy.1.dylib', 'libpmpxy.1.dylib', 'libtaf.0.dylib', 'libtafxy.1.dylib','libsrtp.dylib' ); diff --git a/scripts/cpve_log.pl b/scripts/cpve_log.pl index 5a58a12..cb8979d 100755 --- a/scripts/cpve_log.pl +++ b/scripts/cpve_log.pl @@ -5,13 +5,22 @@ use warnings; use v5.10; ## say #my $log_file = @ARGV[0]; +# +# TODO: +# 1. append cpve version to the file name of full log +# 2. output critical error of CPVE/PME such as "camera" camera error +# 3. split the full log as sub logs against the call time +# 4. plot the RTP stats my $k_start_call = 'originateCall|answercall'; #my $k_start_call = 'originateCall'; # create jabber_full.log to add jabber.log, jabber.log.1, jabber.log.2 +my $out_dir = `pwd` . '/out/'; my @logs = glob "jabber.log*"; -my $full_logs = "jabber_full.log"; +my $full_logs = "$out_dir/jabber_full.log"; + +#my $cpve_version; #foreach (@logs) { say; } #say @logs; @@ -32,14 +41,24 @@ my $full_logs = "jabber_full.log"; ##} ## merge log files -!system "cat $_ >> $full_logs" or die "$!" for (reverse @logs); +!system "cat $_ >> $full_logs" or die "$!" for reverse @logs; + +my $version= +print "===== write done ====\n"; ## split file with each call -open LOG, "<<$full_logs" or die "$!"; +my $call = "call0.log"; -open LOG, "<<$full_logs" or die "$!"; +open CALL, ">> $call" or die "$!"; +open LOG, "<", $full_logs or die "$!"; +my $index = 0; while(){ - +## print CALL $_; +## last if /originateCall/; + if ($_ =~ /originateCall/ ){ + close + $index = $index+1; + open LOG, ">>" "call$index" or die "$!"; + print LOG $_; + } } - - diff --git a/scripts/update_cpve.pl b/scripts/update_cpve.pl index efef836..ae17398 100755 --- a/scripts/update_cpve.pl +++ b/scripts/update_cpve.pl @@ -10,8 +10,8 @@ print "-n $options{n}\n" if defined $options{n}; my $ip = (split / /, `ifconfig | grep "inet .*broadcast"`)[1]; -my $cpve_dir = '/Users/peli3/CPVE/cpve_trunk/'; -my $ecc_dir = '/Users/peli3/JCC/ecc-p2p/'; +my $cpve_dir = '/Users/peli3-imac/CPVE/cpve_trunk/'; +my $ecc_dir = '/Users/peli3-imac/JCC/ecc-p2p-mac/'; my $ecc_mac_libs = "$ecc_dir/contrib/cpve/lib/darwin/x86_64"; my $cpve_mac_libs = "$cpve_dir/target/dist/lib/darwin/x86_64"; @@ -40,6 +40,7 @@ else #### building ecc chdir $ecc_dir or die ": $!"; +!system "rm $ecc_dir/contrib/cpve/SConstruct" or die "$!" if -e "$ecc_dir/contrib/cpve/SConstruct"; !system "python runSconsBuild.py JabberMac64Bit -j 16 -t no --early_cpve --nofetch" or die " building ECC failed : $!"; print "copy bin-s bin-c\n"; @@ -58,11 +59,3 @@ close CONF; print "####### DONE #######\n"; - -#sub get_local_ip{ -# my @cc = (split / /, `ifconfig | grep "inet .*broadcast"`)[1]; -## @cc[1]; ## return value -## return @cc[1]; -#} - -#print CONF "P2P_SERVER_IP=" . &get_local_ip . "\n"; -- 2.11.0