diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2004-10-18 23:14:51 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2004-10-18 23:14:51 +0000 |
| commit | fb8314743c17c15ebcfcebee3565069079a819fc (patch) | |
| tree | 55f0b504462f595df9414882a9140036b361bbf2 /src/util/profile/prof_test1 | |
| parent | 32e9f9545401a17df3443a8e2969d6f84b29e74a (diff) | |
Allow profile library caller to write the modified data to a different
file than was originally read.
* prof_file.c (write_data_to_file): New function, split out from
profile_flush_file_data. Add argument can_create indicating whether the old
file should already exist or not.
(profile_flush_file_data): Call it.
(profile_flush_file_data_to_file): New function.
* prof_int.h (profile_flush_file_data_to_file): Declare it.
(profile_flush_file_to_file): New macro.
* prof_init.c (profile_flush_to_file): New function.
* profile.hin (profile_flush_to_file): Declare.
* profile.swg (profile_flush_to_file): Declare.
* profile_tcl.c: Regenerated.
* prof_test1: Use profile_flush_to_file instead of profile_flush, and reload
from the new filename.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16825 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/profile/prof_test1')
| -rw-r--r-- | src/util/profile/prof_test1 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/profile/prof_test1 b/src/util/profile/prof_test1 index 42a6021f8..d7d5fa8d1 100644 --- a/src/util/profile/prof_test1 +++ b/src/util/profile/prof_test1 @@ -35,10 +35,12 @@ proc test1 {} { } if $verbose { puts "" } #profile_iterator_free $iter - profile_flush $p + catch {file delete $wd/test3.ini} + profile_flush_to_file $p $wd/test3.ini + profile_release $p - if $verbose { puts "Reloading profile" } - set p [profile_init_path $wd/test2.ini] + if $verbose { puts "Reloading new profile" } + set p [profile_init_path $wd/test3.ini] set iter [profile_iterator_create $p $sect 0] set done 0 if $verbose { puts "Iterating again:" } |
