summaryrefslogtreecommitdiff
path: root/src/scripts/genWinEtw.py
diff options
context:
space:
mode:
authorVictor "Nate" Graf <nategraf1@gmail.com>2017-12-20 18:07:52 -0800
committerGitHub <noreply@github.com>2017-12-20 18:07:52 -0800
commit7524d72d4f0f634fe5407280b83c25181dc8c556 (patch)
tree119c7edbbd7b3a0aec47d55334d52d1471e3a3da /src/scripts/genWinEtw.py
parent9891c8ba8f84ff646455b4493447295c591665f4 (diff)
downloadcoreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.gz
coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.tar.bz2
coreclr-7524d72d4f0f634fe5407280b83c25181dc8c556.zip
Enable EventPipe across Unix and Windows (#14772)
* [squashed] most work complete to enable EventPipe on Windows * Eventpipe now builds on Windows * Ensure evevntpipe is intialized on Windows * Resolve the location of python from build.cmd * Ensure eventing files are generated when needed * moving linkage declaration to cmake * create new event from constructor * enable FEATURE_EVENT_TRACE and FEATURE_PERF_TRACE everywhere * [WIP] checkpoint in fixing contarct errors * add another possible python location * Fix double delete bug in EventPipeConfiguration destructor * Fix typo in function name * Revert changes to .gitgnore * bump to netstandard1.6 in preperation for new version of TraceEvent * Revert changes to groovy files * revert changes to perf-prep scripts * add common.h and use nothrow * Fix issue which was causing double delete of configprovider * Add new test utilizing TraceEvent * Remove accidentally added local directory reference * Add comment to explain the addition of misc/tracepointprovider.cpp * Add back sys.exit(0) and refactor * Change conditional to be more direct * Better handle NULL config * Initialize m_deleteDefered * Eliminate obsolete field * Fix spelling error * Fix nits * Make smaple progiler timing functions easier to read * Move projects back to netstandard1.4 * Incomplete improvements to EventPipeTrace test * Add event integrity checks to test * Clean up some left over code * Add EventSource based test * Remove unused PAL tests on Windows * Fix Linux build breaks * Minor changes to CMake files * Remove //HACK for hack that was previously removed * Fix formatting and negate a #ifdef * Add conditional to ensure PERFTRACING is not enabled without EVENT_TRACE * Take lock on EventPipeProvider and EventPipeConfiguration destruction * Load winmm.dll at runtime * Change function name and compile conditions * Move typedef into #ifndef * Use the correct config in setup * Change lifecycle managment of EventPipeConfiguration's configuration provider * Enable EventPipe tests pri0 and disable broken tests * Replace python3 only error with python2 compatable one * Make common.csproj build pri0 * Change TraceEvent version to 2.0.2 to match published verison * Address cross build failure * Remove use of undefined variable * Add crossgen fix to .cmd * Use more specific types to avoid marshalling errors * Use Assert-style statements and remove one check * Fix cross arch build * Fix flipped branch * Bring build.cmd changes to build.sh * Fix cmake writing * Revert "Bring build.cmd changes to build.sh" This reverts commit 893c6492548d8bc9859ebba5b1b810aa630fac63. * remove stdlib.h * Fix out of order null check
Diffstat (limited to 'src/scripts/genWinEtw.py')
-rw-r--r--src/scripts/genWinEtw.py125
1 files changed, 0 insertions, 125 deletions
diff --git a/src/scripts/genWinEtw.py b/src/scripts/genWinEtw.py
deleted file mode 100644
index aa75f680cd..0000000000
--- a/src/scripts/genWinEtw.py
+++ /dev/null
@@ -1,125 +0,0 @@
-
-## Licensed to the .NET Foundation under one or more agreements.
-## The .NET Foundation licenses this file to you under the MIT license.
-## See the LICENSE file in the project root for more information.
-#
-
-import os
-from genXplatEventing import *
-
-stdprolog="""
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/******************************************************************
-
-DO NOT MODIFY. AUTOGENERATED FILE.
-This file is generated using the logic from <root>/src/scripts/genWinEtw.py
-
-******************************************************************/
-
-"""
-import argparse
-import sys
-import xml.dom.minidom as DOM
-
-def generateEtwMacroHeader(sClrEtwAllMan, sExcludeFile,macroHeader,inHeader):
- tree = DOM.parse(sClrEtwAllMan)
- numOfProviders = len(tree.getElementsByTagName('provider'))
- nMaxEventBytesPerProvider = 64
-
- exclusionInfo = parseExclusionList(sExcludeFile)
- incDir = os.path.dirname(os.path.realpath(macroHeader))
- if not os.path.exists(incDir):
- os.makedirs(incDir)
-
- outHeader = open(macroHeader,'w')
- outHeader.write(stdprolog + "\n")
-
- outHeader.write("#include \"" + os.path.basename(inHeader) + '"\n')
- outHeader.write("#define NO_OF_ETW_PROVIDERS " + str(numOfProviders) + "\n")
- outHeader.write("#define MAX_BYTES_PER_ETW_PROVIDER " + str(nMaxEventBytesPerProvider) + "\n")
- outHeader.write("EXTERN_C __declspec(selectany) const BYTE etwStackSupportedEvents[NO_OF_ETW_PROVIDERS][MAX_BYTES_PER_ETW_PROVIDER] = \n{\n")
-
- for providerNode in tree.getElementsByTagName('provider'):
- stackSupportedEvents = [0]*nMaxEventBytesPerProvider
- eventNodes = providerNode.getElementsByTagName('event')
- eventProvider = providerNode.getAttribute('name')
-
- for eventNode in eventNodes:
- taskName = eventNode.getAttribute('task')
- eventSymbol = eventNode.getAttribute('symbol')
- eventTemplate = eventNode.getAttribute('template')
- eventTemplate = eventNode.getAttribute('template')
- eventValue = int(eventNode.getAttribute('value'))
- eventIndex = eventValue // 8
- eventBitPositionInIndex = eventValue % 8
-
- eventStackBitFromNoStackList = int(getStackWalkBit(eventProvider, taskName, eventSymbol, exclusionInfo.nostack))
- eventStackBitFromExplicitStackList = int(getStackWalkBit(eventProvider, taskName, eventSymbol, exclusionInfo.explicitstack))
-
- # Shift those bits into position. For the explicit stack list, swap 0 and 1, so the eventValue* variables
- # have 1 in the position iff we should issue a stack for the event.
- eventValueUsingNoStackListByPosition = (eventStackBitFromNoStackList << eventBitPositionInIndex)
- eventValueUsingExplicitStackListByPosition = ((1 - eventStackBitFromExplicitStackList) << eventBitPositionInIndex)
-
- # Commit the values to the in-memory array that we'll dump into the header file
- stackSupportedEvents[eventIndex] = stackSupportedEvents[eventIndex] | eventValueUsingNoStackListByPosition;
- if eventStackBitFromExplicitStackList == 0:
- stackSupportedEvents[eventIndex] = stackSupportedEvents[eventIndex] | eventValueUsingExplicitStackListByPosition
-
- # print the bit array
- line = []
- line.append("\t{")
- for elem in stackSupportedEvents:
- line.append(str(elem))
- line.append(", ")
-
- del line[-1]
- line.append("},")
- outHeader.write(''.join(line) + "\n")
- outHeader.write("};\n")
-
- outHeader.close()
-
-
-def generateEtwFiles(sClrEtwAllMan, exclusionListFile, etmdummyHeader, macroHeader, inHeader):
-
- checkConsistency(sClrEtwAllMan, exclusionListFile)
- generateEtmDummyHeader(sClrEtwAllMan, etmdummyHeader)
- generateEtwMacroHeader(sClrEtwAllMan, exclusionListFile, macroHeader, inHeader)
-
-def main(argv):
-
- #parse the command line
- parser = argparse.ArgumentParser(description="Generates the Code required to instrument LTTtng logging mechanism")
-
- required = parser.add_argument_group('required arguments')
- required.add_argument('--man', type=str, required=True,
- help='full path to manifest containig the description of events')
- required.add_argument('--exc', type=str, required=True,
- help='full path to exclusion list')
- required.add_argument('--eventheader', type=str, required=True,
- help='full path to the header file')
- required.add_argument('--macroheader', type=str, required=True,
- help='full path to the macro header file')
- required.add_argument('--dummy', type=str, required=True,
- help='full path to file that will have dummy definitions of FireEtw functions')
-
- args, unknown = parser.parse_known_args(argv)
- if unknown:
- print('Unknown argument(s): ', ', '.join(unknown))
- return const.UnknownArguments
-
- sClrEtwAllMan = args.man
- exclusionListFile = args.exc
- inHeader = args.eventheader
- macroHeader = args.macroheader
- etmdummyHeader = args.dummy
-
- generateEtwFiles(sClrEtwAllMan, exclusionListFile, etmdummyHeader, macroHeader, inHeader)
-
-if __name__ == '__main__':
- return_code = main(sys.argv[1:])
- sys.exit(return_code)