コード例 #1
0
        private void PopulateSymbolMapperAndGuids(ZipArchive archive)
        {
            Contract.Requires(archive != null, nameof(archive));

            foreach (var entry in archive.Entries)
            {
                if (MapFilePatterns.IsMatch(entry.FullName))
                {
                    Mapper mapper = new Mapper();

                    // Register the mapper both with and without the .ni extension.
                    // Old versions of the runtime contain native images with the .ni extension.
                    fileSymbolMappers[LinuxPerfScriptEventParser.GetFileNameWithoutExtension(entry.FullName, false)] = mapper;
                    fileSymbolMappers[LinuxPerfScriptEventParser.GetFileNameWithoutExtension(entry.FullName, true)]  = mapper;
                    using (Stream stream = entry.Open())
                    {
                        parser.ParseSymbolFile(stream, mapper);
                    }
                    mapper.DoneMapping();
                }
                else if (PerfInfoPattern.IsMatch(LinuxPerfScriptEventParser.GetFileName(entry.FullName)))
                {
                    Dictionary <string, string> guids = new Dictionary <string, string>();
                    processDllGuids[LinuxPerfScriptEventParser.GetFileName(entry.FullName)] = guids;
                    Dictionary <string, ulong> baseAddresses = new Dictionary <string, ulong>();
                    processDllBaseAddresses[LinuxPerfScriptEventParser.GetFileName(entry.FullName)] = baseAddresses;
                    using (Stream stream = entry.Open())
                    {
                        parser.ParsePerfInfoFile(stream, guids, baseAddresses);
                    }
                }
            }
        }
コード例 #2
0
        public LinuxPerfScriptMapper(ZipArchive archive, LinuxPerfScriptEventParser parser)
        {
            fileSymbolMappers       = new Dictionary <string, Mapper>();
            processDllGuids         = new Dictionary <string, Dictionary <string, string> >();
            processDllBaseAddresses = new Dictionary <string, Dictionary <string, ulong> >();
            this.parser             = parser;

            if (archive != null)
            {
                PopulateSymbolMapperAndGuids(archive);
            }
        }
コード例 #3
0
        public LinuxPerfScriptStackSource(string path, bool doThreadTime)
        {
            this.doThreadTime = doThreadTime;
            currentStackIndex = 0;

            ZipArchive archive;

            using (Stream stream = GetPerfScriptStream(path, out archive))
            {
                masterSource = new FastStream(stream, BufferSize);
                parser       = new LinuxPerfScriptEventParser();
                parser.SetSymbolFile(archive);

                InternAllLinuxEvents(stream);
                stream.Close();
            }
            archive?.Dispose();
        }