Permalink
Browse files

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

--HG--
extra : rebase_source : 52fa198719c18cec660623495542d990ae70f810
  • Loading branch information...
1 parent 921f744 commit d0ef1246d1a30f4a3ddc7de4f75f5a9e6e463c14 @joneschrisg joneschrisg committed Mar 22, 2013
Showing with 11 additions and 3 deletions.
  1. +1 −0 ipc/ipdl/ipdl/builtin.py
  2. +10 −3 ipc/ipdl/ipdl/lower.py
View
@@ -53,4 +53,5 @@
'nsTArray.h',
'nsIFile.h',
'mozilla/ipc/ProtocolUtils.h',
+ 'GeckoProfiler.h'
)
View
@@ -4932,6 +4932,7 @@ def deserializeMessage(self, md, side, errfn):
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 @@ def deserializeReply(self, md, replyexpr, side, errfn):
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 @@ def sendBlocking(self, md, msgexpr, replyexpr, actor=None):
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 @@ def logMessage(self, md, msgptr, pfx):
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():

0 comments on commit d0ef124

Please sign in to comment.