- Timestamp:
- Sep 11, 2023, 12:55:49 PM (13 months ago)
- Branches:
- master
- Children:
- c0035fc
- Parents:
- 9509d67a (diff), 73d0a84c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- libcfa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/extras.c
r9509d67a rc8ec58e 3 3 #include <uchar.h> // char16_t, char32_t 4 4 #include <wchar.h> // wchar_t 5 #include <stdlib.h> // malloc, free, exit, atexit, abort5 #include <stdlib.h> // malloc, free, getenv, exit, atexit, abort, printf 6 6 #include <stdio.h> // printf 7 #include <string.h> // strlen, strcmp, strncmp -
libcfa/prelude/extras.regx2
r9509d67a rc8ec58e 1 1 extern void \*malloc[^;]*; 2 2 extern void free[^;]*; 3 extern char \*getenv[^;]*; 3 4 extern void exit[^;]*; 4 5 extern int atexit[^;]*; 5 6 extern void abort[^;]*; 6 7 extern int printf[^;]*; 8 int strcmp[^;]*; 9 int strncmp[^;]*; 10 size_t strlen[^;]*; -
libcfa/src/clock.hfa
r9509d67a rc8ec58e 10 10 // Created On : Thu Apr 12 14:36:06 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Apr 18 08:12:16 202113 // Update Count : 2812 // Last Modified On : Sat Sep 9 14:07:17 2023 13 // Update Count : 30 14 14 // 15 15 … … 91 91 // discontinuous jumps when the OS is not running the kernal thread. A duration is returned because the value is 92 92 // relative and cannot be converted to real-time (wall-clock) time. 93 Duration processor () {// non-monotonic duration of kernel thread93 Duration processor_cpu() { // non-monotonic duration of kernel thread 94 94 timespec ts; 95 95 clock_gettime( CLOCK_THREAD_CPUTIME_ID, &ts ); 96 96 return (Duration){ ts }; 97 } // processor 97 } // processor_cpu 98 98 99 99 // Program CPU-time watch measures CPU time consumed by all processors (kernel threads) in the UNIX process. This 100 100 // watch is affected by discontinuous jumps when the OS is not running the kernel threads. A duration is returned 101 101 // because the value is relative and cannot be converted to real-time (wall-clock) time. 102 Duration program () {// non-monotonic duration of program CPU102 Duration program_cpu() { // non-monotonic duration of program CPU 103 103 timespec ts; 104 104 clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &ts ); 105 105 return (Duration){ ts }; 106 } // program 106 } // program_cpu 107 107 108 108 // Monotonic duration from machine boot and including system suspension. This watch is unaffected by discontinuous -
libcfa/src/concurrency/kernel/cluster.hfa
r9509d67a rc8ec58e 31 31 32 32 // warn normally all ints 33 #define warn_large_before warnf( !strict || old_avg < 33_000_000_000, "Suspiciously large previous average: %'llu (%llx), %'" PRId64 "ms \n", old_avg, old_avg, program ()`ms )34 #define warn_large_after warnf( !strict || ret < 33_000_000_000, "Suspiciously large new average after %'" PRId64 "ms cputime: %'llu (%llx) from %'llu-%'llu (%'llu, %'llu) and %'llu\n", program ()`ms, ret, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg )33 #define warn_large_before warnf( !strict || old_avg < 33_000_000_000, "Suspiciously large previous average: %'llu (%llx), %'" PRId64 "ms \n", old_avg, old_avg, program_cpu()`ms ) 34 #define warn_large_after warnf( !strict || ret < 33_000_000_000, "Suspiciously large new average after %'" PRId64 "ms cputime: %'llu (%llx) from %'llu-%'llu (%'llu, %'llu) and %'llu\n", program_cpu()`ms, ret, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ) 35 35 36 36 // 8X linear factor is just 8 * x … … 42 42 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2((__readyQ_avg_t)intsc); } 43 43 44 #define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'" PRId64 "ms \n", old_avg, program ()`ms )45 #define warn_large_after warnf( !strict || ret < 35.3, "Suspiciously large new average after %'" PRId64 "ms cputime: %'lf from %'llu-%'llu (%'llu, %'llu) and %'lf\n", program ()`ms, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ); \44 #define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'" PRId64 "ms \n", old_avg, program_cpu()`ms ) 45 #define warn_large_after warnf( !strict || ret < 35.3, "Suspiciously large new average after %'" PRId64 "ms cputime: %'lf from %'llu-%'llu (%'llu, %'llu) and %'lf\n", program_cpu()`ms, ret, currtsc, intsc, new_val, new_val / 1000000, old_avg ); \ 46 46 verify(ret >= 0) 47 47 -
libcfa/src/heap.cfa
r9509d67a rc8ec58e 10 10 // Created On : Tue Dec 19 21:58:35 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 2 18:48:30 202313 // Update Count : 161 412 // Last Modified On : Mon Sep 11 11:21:10 2023 13 // Update Count : 1615 14 14 // 15 15 … … 691 691 return stats; 692 692 } // collectStats 693 694 static inline void clearStats() { 695 lock( mgrLock ); 696 697 // Zero the heap master and all active thread heaps. 698 HeapStatisticsCtor( heapMaster.stats ); 699 for ( Heap * heap = heapMaster.heapManagersList; heap; heap = heap->nextHeapManager ) { 700 HeapStatisticsCtor( heap->stats ); 701 } // for 702 703 unlock( mgrLock ); 704 } // clearStats 693 705 #endif // __STATISTICS__ 694 706 … … 1556 1568 1557 1569 1570 // Zero the heap master and all active thread heaps. 1571 void malloc_stats_clear() { 1572 #ifdef __STATISTICS__ 1573 clearStats(); 1574 #else 1575 #define MALLOC_STATS_MSG "malloc_stats statistics disabled.\n" 1576 if ( write( STDERR_FILENO, MALLOC_STATS_MSG, sizeof( MALLOC_STATS_MSG ) - 1 /* size includes '\0' */ ) == -1 ) { 1577 abort( "**** Error **** write failed in malloc_stats" ); 1578 } // if 1579 #endif // __STATISTICS__ 1580 } // malloc_stats_clear 1581 1582 1558 1583 // Changes the file descriptor where malloc_stats() writes statistics. 1559 1584 int malloc_stats_fd( int fd __attribute__(( unused )) ) libcfa_public { -
libcfa/src/heap.hfa
r9509d67a rc8ec58e 10 10 // Created On : Tue May 26 11:23:55 2020 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Oct 4 19:08:55 202213 // Update Count : 2 312 // Last Modified On : Mon Sep 11 11:18:18 2023 13 // Update Count : 24 14 14 // 15 15 … … 43 43 size_t malloc_mmap_start(); // crossover allocation size from sbrk to mmap 44 44 size_t malloc_unfreed(); // heap unfreed size (bytes) 45 void malloc_stats_clear(); // clear heap statistics 45 46 } // extern "C" 46 47 -
libcfa/src/iostream.cfa
r9509d67a rc8ec58e 1 1 2 // 2 3 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo … … 976 977 if ( f.flags.ignore ) { fmtstr[1] = '*'; start += 1; } 977 978 // no maximum width necessary because text ignored => width is read width 978 if ( f.wd != -1 ) { start += sprintf( &fmtstr[start], "%d", f.wd ); } 979 if ( f.wd != -1 ) { 980 // wd is buffer bytes available (for input chars + null terminator) 981 // rwd is count of input chars 982 int rwd = f.flags.rwd ? f.wd : (f.wd - 1); 983 start += sprintf( &fmtstr[start], "%d", rwd ); 984 } 979 985 980 986 if ( ! scanset ) { … … 993 999 } // if 994 1000 995 int check = f.wd - 1;1001 int check = f.wd - 2; 996 1002 if ( ! f.flags.rwd ) f.s[check] = '\0'; // insert sentinel 997 1003 len = fmt( is, fmtstr, f.s );
Note: See TracChangeset
for help on using the changeset viewer.