Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
cleanup and add setDocumentInspectionTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Qusic committed Sep 20, 2018
1 parent dd2cd7a commit c2bf2b8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 54 deletions.
55 changes: 1 addition & 54 deletions TraceUtility/InstrumentsPrivateHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ BOOL XRAnalysisCoreReadCursorGetValue(XRAnalysisCoreReadCursor *cursor, UInt8 co

@interface XRAnalysisCoreTableViewController : NSViewController <XRFilteredDataSource, XRSearchTarget>
- (DTRenderableContentResponse *)_currentResponse;
- (void)setDocumentInspectionTime:(XRTime)inspectionTime;
@end

@interface XRManagedEventArrayController : NSArrayController
Expand Down Expand Up @@ -287,57 +288,3 @@ BOOL XRAnalysisCoreReadCursorGetValue(XRAnalysisCoreReadCursor *cursor, UInt8 co
}
- (NSArray<XRContext *> *)_topLevelContexts;
@end

//@interface XRVideoCardRun : XRRun {
// NSArrayController *_controller;
//}
//@end
//
//@interface XRVideoCardInstrument : XRLegacyInstrument
//@end

//@interface XRNetworkAddressFormatter : NSFormatter
//@end
//
//@interface XRNetworkingInstrument : XRLegacyInstrument {
// XRContext * __strong *_topLevelContexts;
// NSArrayController * __strong *_controllersByTable;
// XRNetworkAddressFormatter *_localAddrFmtr;
// XRNetworkAddressFormatter *_remoteAddrFmtr;
//}
//- (void)selectedRunRecomputeSummaries;
//@end

//typedef struct {
// XRTimeRange range;
// UInt64 idx;
// UInt32 recno;
//} XRPowerTimelineEntry;
//
//@interface XRPowerTimeline : NSObject
//- (UInt64)count;
//- (UInt64)lastIndex;
//- (XRTime)lastTimeOffset;
//- (void)enumerateTimeRange:(XRTimeRange)timeRange sequenceNumberRange:(NSRange)numberRange block:(void (^)(const XRPowerTimelineEntry *entry, BOOL *stop))block;
//@end
//
//@interface XRPowerStreamDefinition : NSObject
//- (UInt64)columnsInDataStreamCount;
//@end
//
//@interface XRPowerDatum : NSObject
//- (XRTimeRange)time;
//- (NSString *)labelForColumn:(SInt64)column;
//- (id)objectValueForColumn:(SInt64)column;
//@end
//
//@interface XRPowerDetailController : NSObject
//- (XRPowerDatum *)datumAtObjectIndex:(UInt64)index;
//@end
//
//@interface XRStreamedPowerInstrument : XRLegacyInstrument {
// XRPowerDetailController *_detailController;
//}
//- (XRPowerStreamDefinition *)definitionForCurrentDetailView;
//- (XRPowerTimeline *)selectedEventTimeline;
//@end
27 changes: 27 additions & 0 deletions TraceUtility/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,33 @@ int main(int argc, const char * argv[]) {
}
}];
}];
} else if ([instrumentID isEqualToString:@"com.apple.xray.instrument-type.activity"]) {
// Activity Monitor
XRContext *context = contexts[0];
[context display];
XRAnalysisCoreTableViewController *controller = TUIvar(context.container, _tabularViewController);
XRTime duration = run.timeRange.length;
for (XRTime time = 0; time < duration; time += NSEC_PER_SEC) {
[controller setDocumentInspectionTime:time];
XRAnalysisCorePivotArray *array = controller._currentResponse.content.rows;
XREngineeringTypeFormatter *formatter = TUIvarCast(array.source, _filter, XRAnalysisCoreTableQuery * const).fullTextSearchSpec.formatter;
[array access:^(XRAnalysisCorePivotArrayAccessor *accessor) {
[accessor readRowsStartingAt:0 dimension:0 block:^(XRAnalysisCoreReadCursor *cursor) {
SInt64 columnCount = XRAnalysisCoreReadCursorColumnCount(cursor);
while (XRAnalysisCoreReadCursorNext(cursor)) {
BOOL result = NO;
XRAnalysisCoreValue *object = nil;
NSMutableString *string = [NSMutableString string];
for (SInt64 column = 0; column < columnCount; column++) {
result = XRAnalysisCoreReadCursorGetValue(cursor, column, &object);
[string appendString:result ? [formatter stringForObjectValue:object] : @""];
[string appendFormat:@", "];
}
TUPrint(@"%@", string);
}
}];
}];
}
} else {
TUPrint(@"Data processor has not been implemented for this type of instrument.\n");
}
Expand Down

0 comments on commit c2bf2b8

Please sign in to comment.