Lines Matching defs:pStrm

406     PSCMSTREAM pStrm   = (PSCMSTREAM)pvUser;
411 ScmStreamPrintf(pStrm,
424 * @param pStrm The output stream.
426 static RTEXITCODE generateAssembly(PSCMSTREAM pStrm)
439 ScmStreamPrintf(pStrm,
577 ScmStreamPrintf(pStrm,
593 ScmStreamPrintf(pStrm,
600 RTStrSpaceEnumerate(&g_StrSpace, generateAssemblyStrTabCallback, pStrm);
601 ScmStreamPrintf(pStrm,
607 ScmStreamPrintf(pStrm,
624 ScmStreamPrintf(pStrm,
633 ScmStreamPrintf(pStrm,
671 ScmStreamPrintf(pStrm,
678 ScmStreamPrintf(pStrm,
693 ScmStreamPrintf(pStrm,
714 ScmStreamPrintf(pStrm, "VTG_GLOBAL g_aVTGProbes_End, data\n");
719 ScmStreamPrintf(pStrm,
729 ScmStreamPrintf(pStrm,
752 ScmStreamPrintf(pStrm, "VTG_GLOBAL g_aVTGProviders_End, data\n");
761 ScmStreamPrintf(pStrm,
773 ScmStreamPrintf(pStrm,
780 ScmStreamPrintf(pStrm, "VTG_GLOBAL g_acVTGProbeEnabled_End, data\n");
790 ScmStreamPrintf(pStrm,
798 ScmStreamPrintf(pStrm,
803 ScmStreamPrintf(pStrm, "extern NAME(%s)\n", g_pszProbeFnName);
809 ScmStreamPrintf(pStrm,
815 ScmStreamPrintf(pStrm, ", %s %s", pArg->pszTracerType, pArg->pszName);
817 ScmStreamPrintf(pStrm,
824 ScmStreamPrintf(pStrm,
829 ScmStreamPrintf(pStrm,
833 ScmStreamPrintf(pStrm,
841 ScmStreamPrintf(pStrm, g_fPic && fElf ?
850 ScmStreamPrintf(pStrm, g_fPic && fElf ?
858 ScmStreamPrintf(pStrm,
915 * @param pStrm The output stream.
917 static RTEXITCODE generateHeader(PSCMSTREAM pStrm)
943 ScmStreamPrintf(pStrm,
986 ScmStreamPrintf(pStrm,
995 ScmStreamPrintf(pStrm, ", %s", pArg->pszCtxType);
998 ScmStreamPrintf(pStrm,
1009 ScmStreamPrintf(pStrm, "%s", pArg->pszName);
1011 ScmStreamPrintf(pStrm, ", %s", pArg->pszName);
1013 ScmStreamPrintf(pStrm,
1026 ScmStreamPrintf(pStrm, pArg->pszArgPassingFmt, pArg->pszName);
1028 ScmStreamPrintf(pStrm,
1036 ScmStreamPrintf(pStrm,
1042 ScmStreamPrintf(pStrm,
1049 ScmStreamPrintf(pStrm,
1056 ScmStreamPrintf(pStrm,
1065 ScmStreamPrintf(pStrm,
1072 ScmStreamPrintf(pStrm, "%s", pArg->pszName);
1074 ScmStreamPrintf(pStrm, ", %s", pArg->pszName);
1076 ScmStreamPrintf(pStrm,
1081 ScmStreamWrite(pStrm, RT_STR_TUPLE("\n"
1094 * @param pStrm The output stream.
1096 static RTEXITCODE generateWrapperHeader(PSCMSTREAM pStrm)
1119 ScmStreamPrintf(pStrm,
1156 ScmStreamPrintf(pStrm,
1162 ScmStreamPrintf(pStrm, "%s", pArg->pszName);
1164 ScmStreamPrintf(pStrm, ", %s", pArg->pszName);
1166 ScmStreamPrintf(pStrm,
1181 ScmStreamPrintf(pStrm, "(%s)%M", pArg->pszTracerType, pszFmt, pArg->pszName);
1183 ScmStreamPrintf(pStrm, ", (%s)%M", pArg->pszTracerType, pszFmt, pArg->pszName);
1190 ScmStreamPrintf(pStrm, "(char *)%M", pszFmt, pArg->pszName);
1192 ScmStreamPrintf(pStrm, ", (char *)%M", pszFmt, pArg->pszName);
1197 ScmStreamPrintf(pStrm, pArg->pszArgPassingFmt + sizeof(", ") - 1, pArg->pszName);
1199 ScmStreamPrintf(pStrm, pArg->pszArgPassingFmt, pArg->pszName);
1202 ScmStreamPrintf(pStrm,
1210 ScmStreamPrintf(pStrm,
1219 ScmStreamPrintf(pStrm,
1225 ScmStreamPrintf(pStrm, "%s", pArg->pszName);
1227 ScmStreamPrintf(pStrm, ", %s", pArg->pszName);
1229 ScmStreamPrintf(pStrm,
1234 ScmStreamWrite(pStrm, RT_STR_TUPLE("\n"
1246 * @param pStrm The stream.
1251 static RTEXITCODE parseError(PSCMSTREAM pStrm, size_t cb, const char *pszMsg)
1254 ScmStreamSeekRelative(pStrm, -(ssize_t)cb);
1255 size_t const off = ScmStreamTell(pStrm);
1256 size_t const iLine = ScmStreamTellLine(pStrm);
1257 ScmStreamSeekByLine(pStrm, iLine);
1258 size_t const offLine = ScmStreamTell(pStrm);
1264 const char *pszLine = ScmStreamGetLineByNo(pStrm, iLine, &cchLine, &enmEof);
1277 * @param pStrm The stream.
1282 static RTEXITCODE parseErrorAbs(PSCMSTREAM pStrm, size_t off, const char *pszMsg)
1284 ScmStreamSeekAbsolute(pStrm, off);
1285 return parseError(pStrm, 0, pszMsg);
1292 * @param pStrm The stream.
1294 static RTEXITCODE parseOneLineComment(PSCMSTREAM pStrm)
1296 ScmStreamSeekByLine(pStrm, ScmStreamTellLine(pStrm) + 1);
1304 * @param pStrm The stream.
1306 static RTEXITCODE parseMultiLineComment(PSCMSTREAM pStrm)
1309 while ((ch = ScmStreamGetCh(pStrm)) != ~(unsigned)0)
1314 ch = ScmStreamGetCh(pStrm);
1321 parseError(pStrm, 1, "Expected end of comment, got end of file");
1330 * @param pStrm The stream..
1332 static RTEXITCODE parseSkipSpacesAndComments(PSCMSTREAM pStrm)
1335 while ((ch = ScmStreamPeekCh(pStrm)) != ~(unsigned)0)
1339 unsigned ch2 = ScmStreamGetCh(pStrm); AssertBreak(ch == ch2); NOREF(ch2);
1342 ch = ScmStreamGetCh(pStrm);
1345 rcExit = parseMultiLineComment(pStrm);
1347 rcExit = parseOneLineComment(pStrm);
1349 rcExit = parseError(pStrm, 2, "Unexpected character");
1355 return parseError(pStrm, 0, "Unexpected end of file");
1364 * @param pStrm The stream.
1366 static unsigned parseGetNextNonSpaceNonCommentCh(PSCMSTREAM pStrm)
1369 while ((ch = ScmStreamGetCh(pStrm)) != ~(unsigned)0)
1375 ch = ScmStreamGetCh(pStrm);
1378 rcExit = parseMultiLineComment(pStrm);
1380 rcExit = parseOneLineComment(pStrm);
1382 rcExit = parseError(pStrm, 2, "Unexpected character");
1388 parseError(pStrm, 0, "Unexpected end of file");
1397 * @param pStrm The stream.
1399 static unsigned parseGetNextNonSpaceNonCommentChOnPpLine(PSCMSTREAM pStrm)
1401 size_t off = ScmStreamTell(pStrm) - 1;
1403 while ((ch = ScmStreamGetCh(pStrm)) != ~(unsigned)0)
1409 parseErrorAbs(pStrm, off, "Invalid preprocessor statement");
1415 size_t off2 = ScmStreamTell(pStrm) - 1;
1416 ch = ScmStreamGetCh(pStrm);
1418 ch = ScmStreamGetCh(pStrm);
1421 parseErrorAbs(pStrm, off2, "Expected new line");
1437 * @param pStrm The stream..
1440 static const char *parseGetNextCWord(PSCMSTREAM pStrm, size_t *pcchWord)
1442 if (parseSkipSpacesAndComments(pStrm) != RTEXITCODE_SUCCESS)
1444 return ScmStreamCGetWord(pStrm, pcchWord);
1454 * @param pStrm The stream.
1457 static kVTGStability parseStability(PSCMSTREAM pStrm, unsigned ch)
1462 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("External")))
1464 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Evolving")))
1468 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Internal")))
1472 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Obsolete")))
1476 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Private")))
1480 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Stable")))
1482 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Standard")))
1486 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Unstable")))
1490 parseError(pStrm, 1, "Unknown stability specifier");
1500 * @param pStrm The stream.
1503 static kVTGClass parseDataDepClass(PSCMSTREAM pStrm, unsigned ch)
1508 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Common")))
1510 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Cpu")))
1514 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Group")))
1518 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Isa")))
1522 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Platform")))
1526 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("Unknown")))
1530 parseError(pStrm, 1, "Unknown data dependency class specifier");
1538 * @param pStrm The stream.
1540 static RTEXITCODE parsePragmaDAttributes(PSCMSTREAM pStrm)
1545 unsigned ch = parseGetNextNonSpaceNonCommentChOnPpLine(pStrm);
1549 kVTGStability enmCode = parseStability(pStrm, ch);
1552 ch = ScmStreamGetCh(pStrm);
1554 return parseError(pStrm, 1, "Expected '/' following the code stability specifier");
1556 kVTGStability enmData = parseStability(pStrm, ScmStreamGetCh(pStrm));
1559 ch = ScmStreamGetCh(pStrm);
1561 return parseError(pStrm, 1, "Expected '/' following the data stability specifier");
1563 kVTGClass enmDataDep = parseDataDepClass(pStrm, ScmStreamGetCh(pStrm));
1570 ch = parseGetNextNonSpaceNonCommentChOnPpLine(pStrm);
1573 if (ch != 'p' || !ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("provider")))
1574 return parseError(pStrm, 1, "Expected 'provider'");
1577 const char *pszName = parseGetNextCWord(pStrm, &cchName);
1579 return parseError(pStrm, 1, "Expected provider name");
1589 return parseError(pStrm, cchName, "Provider not found");
1595 const char *pszAspect = parseGetNextCWord(pStrm, &cchAspect);
1597 return parseError(pStrm, 1, "Expected provider aspect");
1611 return parseError(pStrm, cchAspect, "Unknown aspect");
1614 return parseError(pStrm, cchAspect, "You have already specified these attributes");
1626 * @param pStrm The stream.
1628 static RTEXITCODE parsePragma(PSCMSTREAM pStrm)
1631 unsigned ch = parseGetNextNonSpaceNonCommentChOnPpLine(pStrm);
1634 else if (ch == 'D' && ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("D")))
1636 ch = parseGetNextNonSpaceNonCommentChOnPpLine(pStrm);
1639 else if (ch == 'a' && ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("attributes")))
1640 rcExit = parsePragmaDAttributes(pStrm);
1642 rcExit = parseError(pStrm, 1, "Unknown pragma D");
1645 rcExit = parseError(pStrm, 1, "Unknown pragma");
1808 * @param pStrm The input stream (for errors).
1814 static RTEXITCODE parseInitArgument(PVTGPROBE pProbe, PVTGARG pArg, PSCMSTREAM pStrm,
1823 return parseError(pStrm, 1, "Out of memory");
1852 return parseError(pStrm, 1, "The automatic ring-0 pointer conversion requires 'a_pVCpu' with type 'struct VMCPU *' as the first argument");
1869 return parseError(pStrm, 1, "Out of memory");
1910 * @param pStrm The stream.
1913 static RTEXITCODE parseProbe(PSCMSTREAM pStrm, PVTGPROVIDER pProv)
1919 const char *pszProbe = parseGetNextCWord(pStrm, &cchProbe);
1921 return parseError(pStrm, 1, "Expected a probe name starting with an alphabetical character");
1922 unsigned ch = parseGetNextNonSpaceNonCommentCh(pStrm);
1924 return parseError(pStrm, 1, "Expected '(' after the probe name");
1931 return parseError(pStrm, 0, "Out of memory");
1937 return parseError(pStrm, 0, "Out of memory");
1940 return parseError(pStrm, 0, "Out of memory");
1951 ch = parseGetNextNonSpaceNonCommentCh(pStrm);
1961 return parseError(pStrm, 1, "Argument has no name");
1963 return parseError(pStrm, 1, "Argument type too long");
1964 RTEXITCODE rcExit = parseInitArgument(pProbe, pArg, pStrm,
1976 size_t off = ScmStreamTell(pStrm);
1977 ch = parseGetNextNonSpaceNonCommentCh(pStrm);
1979 return parseErrorAbs(pStrm, off, "Expected ';'");
1988 const char *pszWord = ScmStreamCGetWordM1(pStrm, &cchWord);
1990 return parseError(pStrm, 0, "Expected argument");
1995 return parseError(pStrm, 1, "Out of memory");
2000 return parseError(pStrm, 1, "Too long parameter declaration");
2009 return parseError(pStrm, 1, "Too long parameter declaration");
2023 return parseError(pStrm, 1, "A parameter type does not start with an asterix");
2025 return parseError(pStrm, 1, "Too long parameter declaration");
2034 return parseError(pStrm, 0, "Missing closing ')' on probe");
2043 * @param pStrm The stream.
2045 static RTEXITCODE parseProvider(PSCMSTREAM pStrm)
2050 RTEXITCODE rcExit = parseSkipSpacesAndComments(pStrm);
2052 return parseError(pStrm, 1, "Expected a provider name starting with an alphabetical character");
2054 const char *pszName = ScmStreamCGetWord(pStrm, &cchName);
2056 return parseError(pStrm, 0, "Bad provider name");
2058 return parseError(pStrm, 1, "A provider name cannot end with digit");
2060 unsigned ch = parseGetNextNonSpaceNonCommentCh(pStrm);
2062 return parseError(pStrm, 1, "Expected '{' after the provider name");
2069 return parseError(pStrm, 0, "Out of memory");
2074 return parseError(pStrm, 0, "Out of memory");
2081 ch = parseGetNextNonSpaceNonCommentCh(pStrm);
2085 if (ScmStreamCMatchingWordM1(pStrm, RT_STR_TUPLE("probe")))
2086 rcExit = parseProbe(pStrm, pProv);
2088 rcExit = parseError(pStrm, 1, "Unexpected character");
2093 size_t off = ScmStreamTell(pStrm);
2094 ch = parseGetNextNonSpaceNonCommentCh(pStrm);
2097 rcExit = parseErrorAbs(pStrm, off, "Expected ';'");
2102 rcExit = parseError(pStrm, 0, "Missing closing '}' on provider");
2106 rcExit = parseError(pStrm, 1, "Unexpected character");