Exemplo n.º 1
0
        /// <summary>
        /// Dumps the specified pip.
        /// </summary>
        /// <returns>0 if dump pip was successful, or 1 if dump pip was unsuccessful</returns>
        public override int Analyze()
        {
            var directoryCreateResult = DumpPipLiteAnalysisUtilities.CreateLoggingDirectory(m_logPath, LoggingContext);
            var dumpPipResult         = false;

            if (directoryCreateResult)
            {
                dumpPipResult = DumpPipLiteAnalysisUtilities.DumpPip(
                    m_pip,
                    m_dynamicData,
                    m_logPath,
                    PathTable,
                    StringTable,
                    SymbolTable,
                    m_pipGraph,
                    LoggingContext
                    );
            }

            if (!(directoryCreateResult && dumpPipResult))
            {
                return(1); // An error should be logged for this already
            }

            return(0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// If the user specifies a single pip with the /pip option, this function will dump that pip.
        /// </summary>
        /// <returns>0 if dump pip was successful, or 1 if dump pip was unsuccessful</returns>
        public override int Analyze()
        {
            if (!m_dumpAllFailedPips)
            {
                bool directoryCreateResult = DumpPipLiteAnalysisUtilities.CreateLoggingDirectory(m_logPath, LoggingContext);
                bool dumpPipResult         = false;

                if (directoryCreateResult)
                {
                    dumpPipResult = DumpPipLiteAnalysisUtilities.DumpPip(m_pip, m_logPath, PathTable, StringTable, SymbolTable, m_pipGraph, LoggingContext);
                }

                if (!(directoryCreateResult && dumpPipResult))
                {
                    // An error should be logged for this already
                    return(1);
                }
            }

            return(0);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Dumps all failing pips is the /dumpAllFailedPips flag is set.
        /// </summary>
        /// <param name="data"></param>
        public override void PipExecutionPerformance(PipExecutionPerformanceEventData data)
        {
            if (m_dumpAllFailedPips && data.ExecutionPerformance.ExecutionLevel == PipExecutionLevel.Failed)
            {
                if (!m_isLogDirectoryCreated)
                {
                    m_isLogDirectoryCreated = DumpPipLiteAnalysisUtilities.CreateLoggingDirectory(m_logPath, LoggingContext);
                }

                if (m_isLogDirectoryCreated)
                {
                    var pip = m_pipTable.HydratePip(data.PipId, PipQueryContext.DumpPipLiteAnalyzer);

                    // A log entry should have been generated already if this fails
                    DumpPipLiteAnalysisUtilities.DumpPip(pip,
                                                         m_logPath,
                                                         PathTable,
                                                         StringTable,
                                                         SymbolTable,
                                                         m_pipGraph);
                }
            }
        }
 private bool CreateLogPathAndRun(Pip pip, PipGraph graph)
 {
     DumpPipLiteAnalysisUtilities.CreateLoggingDirectory(m_logPath, LoggingContext);
     return(DumpPipLiteAnalysisUtilities.DumpPip(pip, m_logPath, Context.PathTable, Context.StringTable, Context.SymbolTable, graph, LoggingContext));
 }