Bug 853363 - Add profiler labels for IPDL IPC. r=benjamin

--HG--
extra : rebase_source : 52fa198719c18cec660623495542d990ae70f810
This commit is contained in:
Chris Jones 2013-03-22 14:57:59 +01:00
parent 06030702e3
commit c65d27ed5f
2 changed files with 11 additions and 3 deletions

View File

@ -53,4 +53,5 @@ Includes = (
'nsTArray.h',
'nsIFile.h',
'mozilla/ipc/ProtocolUtils.h',
'GeckoProfiler.h'
)

View File

@ -4932,6 +4932,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
args=[ ExprLiteral.String(md.prettyMsgName(self.protocol.name
+'::')) ])),
self.logMessage(md, md.msgCast(msgexpr), 'Received '),
self.profilerLabel('Recv', md.decl.progname),
Whitespace.NL
])
@ -4986,13 +4987,13 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
return stmts
def sendAsync(self, md, msgexpr, actor=None):
sendok = ExprVar('__sendok')
return (
sendok,
([ Whitespace.NL,
self.logMessage(md, msgexpr, 'Sending ') ]
self.logMessage(md, msgexpr, 'Sending '),
self.profilerLabel('AsyncSend', md.decl.progname) ]
+ self.transition(md, 'out', actor)
+ [ Whitespace.NL,
StmtDecl(Decl(Type.BOOL, sendok.name),
@ -5008,7 +5009,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
return (
sendok,
([ Whitespace.NL,
self.logMessage(md, msgexpr, 'Sending ') ]
self.logMessage(md, msgexpr, 'Sending '),
self.profilerLabel('Send', md.decl.progname) ]
+ self.transition(md, 'out', actor)
+ [ Whitespace.NL,
StmtDecl(
@ -5084,6 +5086,11 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
args=[ ExprLiteral.String('['+ actorname +'] '+ pfx),
ExprVar('stderr') ])) ])
def profilerLabel(self, tag, msgname):
return StmtExpr(ExprCall(ExprVar('PROFILER_LABEL'),
[ ExprLiteral.String('IPDL::' + self.protocol.name),
ExprLiteral.String(tag + msgname) ]))
def saveActorId(self, md):
idvar = ExprVar('__id')
if md.decl.type.hasReply():