Changeset 1316
- Timestamp:
- Mar 17, 2004, 5:00:43 AM (21 years ago)
- Location:
- trunk/src/emx/src/lib/sys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/logstrict.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1315 r1316 21 21 22 22 #define ISDIGIT(c) ((c) >= '0' && (c) <= '9') 23 #define MAX(a, b) ((a) >= (b) ? (a) : (b))24 #define MIN(a, b) ((a) < (b) ? (a) : (b))23 //#define MAX(a, b) ((a) >= (b) ? (a) : (b)) 24 //#define MIN(a, b) ((a) < (b) ? (a) : (b)) 25 25 26 26 #define NTSF_CAPITAL 0x0001 … … 48 48 #include <setjmp.h> 49 49 #include <machine/param.h> 50 #include <InnoTekLIBC/thread.h> 50 51 51 52 #define INCL_BASE … … 247 248 DosWrite(pInst->hFile, psz, cch, &cb); 248 249 DosWrite(pInst->hFile, "\n", 1, &cb); 250 251 cch = __libc_logSNPrintf(pszMsg, CCHTMPMSGBUFFER, 252 "\n" 253 " Millsecond Timestamp.\n" 254 " | Thread ID.\n" 255 " | | Call Nesting Level.\n" 256 " | | | Log Group.\n" 257 " | | | | Message Type.\n" 258 " | | | | | Function Name.\n" 259 " | | | | | | Millisconds In function (Optional).\n" 260 " v v v v v v v\n" 261 "xxxxxxxx tt nn gggg dddd function [( ms)]: message\n"); 262 DosWrite(pInst->hFile, pszMsg, cch, &cb); 249 263 } 250 264 … … 390 404 { 1, "MUTEX" }, /* 13 */ 391 405 { 1, "SIGNAL" }, /* 14 */ 392 { 1, " future" },/* 15 */406 { 1, "ENV" }, /* 15 */ 393 407 { 1, "future" }, /* 16 */ 394 408 { 1, "future" }, /* 17 */ … … 581 595 va_list args; 582 596 __LIBC_PLOGINST pInst; 597 unsigned *pcDepth = NULL; 598 unsigned cDepth; 583 599 584 600 /* … … 587 603 if (!pvInstance) 588 604 { 605 __LIBC_PTHREAD pThread; 589 606 pvInstance = __libc_logDefault(); 590 607 if (!pvInstance) 591 608 return uTS; 609 pThread = __libc_threadCurrentNoAuto(); 610 if (pThread) 611 pcDepth = &pThread->cDefLoggerDepth; 592 612 } 593 613 pInst = (__LIBC_PLOGINST)pvInstance; … … 606 626 607 627 /* 628 * Nesting depth. 629 */ 630 if (pcDepth) 631 cDepth = ++*pcDepth; 632 else 633 cDepth = 0xff; 634 635 /* 608 636 * Allocate logging buffer and format the message. 609 637 */ … … 613 641 614 642 va_start(args, pszFormat); 615 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %0 4x Entr %s: ",616 uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction);643 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %02x %04x Entr %s: ", 644 uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction); 617 645 va_end(args); 618 646 … … 645 673 va_list args; 646 674 __LIBC_PLOGINST pInst; 675 unsigned *pcDepth = NULL; 676 unsigned cDepth; 647 677 648 678 /* … … 651 681 if (!pvInstance) 652 682 { 683 __LIBC_PTHREAD pThread; 653 684 pvInstance = __libc_logDefault(); 654 685 if (!pvInstance) 655 686 return; 687 pThread = __libc_threadCurrentNoAuto(); 688 if (pThread) 689 pcDepth = &pThread->cDefLoggerDepth; 656 690 } 657 691 pInst = (__LIBC_PLOGINST)pvInstance; … … 670 704 671 705 /* 706 * Nesting depth. 707 */ 708 if (pcDepth) 709 { 710 if (*pcDepth) 711 cDepth = --*pcDepth; 712 else 713 cDepth = 0xfe; 714 } 715 else 716 cDepth = 0xff; 717 718 /* 672 719 * Allocate logging buffer and format the message. 673 720 */ … … 677 724 678 725 va_start(args, pszFormat); 679 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %0 4x Leav %s (%2d ms): ",680 uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction, uTS - uEnterTS);726 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %02x %04x Leav %s (%2d ms): ", 727 uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction, uTS - uEnterTS); 681 728 va_end(args); 682 729 … … 708 755 va_list args; 709 756 __LIBC_PLOGINST pInst; 757 unsigned cDepth = 0xff; 710 758 711 759 /* … … 714 762 if (!pvInstance) 715 763 { 764 __LIBC_PTHREAD pThread; 716 765 pvInstance = __libc_logDefault(); 717 766 if (!pvInstance) 718 767 return; 768 pThread = __libc_threadCurrentNoAuto(); 769 if (pThread) 770 cDepth = pThread->cDefLoggerDepth; 719 771 } 720 772 pInst = (__LIBC_PLOGINST)pvInstance; … … 741 793 va_start(args, pszFormat); 742 794 if (uEnterTS != ~0) 743 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %0 4x Mesg %s (%2d ms): ",744 uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction, uTS - uEnterTS);795 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %02x %04x Mesg %s (%2d ms): ", 796 uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction, uTS - uEnterTS); 745 797 else 746 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %0 4x Mesg %s: ",747 uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction);798 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %02x %04x Mesg %s: ", 799 uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction); 748 800 va_end(args); 749 801 … … 831 883 va_list args; 832 884 __LIBC_PLOGINST pInst; 885 unsigned cDepth = 0xff; 833 886 FS_VAR(); 834 887 … … 848 901 if (!pvInstance) 849 902 { 903 __LIBC_PTHREAD pThread; 850 904 pvInstance = __libc_logDefault(); 851 905 if (!pvInstance) 852 906 return; 907 pThread = __libc_threadCurrentNoAuto(); 908 if (pThread) 909 cDepth = pThread->cDefLoggerDepth; 853 910 } 854 911 pInst = (__LIBC_PLOGINST)pvInstance; … … 881 938 FS_SAVE_LOAD(); 882 939 va_start(args, pszFormat); /* make compiler happy we do it here. */ 883 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %0 4x Asrt: Assertion Failed!!!\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags));940 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %02x %04x Asrt: Assertion Failed!!!\n", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags)); 884 941 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 885 942 if (fEnabled) 886 943 DosWrite(2, pszMsg, cch, &cb); 887 944 888 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %0 4x Asrt: Function: %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction);945 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %02x %04x Asrt: Function: %s\n", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFunction); 889 946 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 890 947 if (fEnabled) 891 948 DosWrite(2, pszMsg, cch, &cb); 892 949 893 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %0 4x Asrt: File: %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFile);950 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %02x %04x Asrt: File: %s\n", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszFile); 894 951 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 895 952 if (fEnabled) 896 953 DosWrite(2, pszMsg, cch, &cb); 897 954 898 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %0 4x Asrt: Line: %d\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), uLine);955 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %02x %04x Asrt: Line: %d\n", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), uLine); 899 956 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 900 957 if (fEnabled) 901 958 DosWrite(2, pszMsg, cch, &cb); 902 959 903 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %0 4x Asrt: Expr: %s\n", uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags), pszExpression);960 cch = __libc_logBuildMsg(pszMsg, "", args, "%08x %02x %02x %04x Asrt: Expr: %s\n", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags), pszExpression); 904 961 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 905 962 if (fEnabled) 906 963 DosWrite(2, pszMsg, cch, &cb); 907 964 908 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %04x Asrt: ", 909 uTS, getTid(), __LIBC_LOG_GETGROUP(fGroupAndFlags)); 965 cch = __libc_logBuildMsg(pszMsg, pszFormat, args, "%08x %02x %02x %04x Asrt: ", uTS, getTid(), cDepth, __LIBC_LOG_GETGROUP(fGroupAndFlags)); 910 966 __libc_logWrite(pInst, fGroupAndFlags, pszMsg, cch); 911 967 if (fEnabled) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/syscalls.h
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1315 r1316 9 9 #ifndef __LIBC_THREAD_DECLARED 10 10 #define __LIBC_THREAD_DECLARED 11 struct __libc_thread CurrentSlow;12 typedef struct __libc_thread CurrentSlow*__LIBC_PTHREAD, **__LIBC_PPTHREAD;11 struct __libc_thread; 12 typedef struct __libc_thread *__LIBC_PTHREAD, **__LIBC_PPTHREAD; 13 13 #endif 14 14 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.