編集する

編集する

grepAndroidロギングを拡張しようとしています。ただし、アンカーポイントを一致させることはできません。

これは私の質問です -

grep -A 25 -E 'show\(authenticated = |onAllPanelsCollapsed\(\)|makeExpandedInvisible$'

マッチしたい

  • show(authenticated =または
  • onAllPanelsCollapsed()または
  • makeExpandedInvisible 行末で

しかし、私がいつも得た結果は次のとおりです。

D/KeyguardBouncer(  855): show(authenticated = false) is called.
D/KeyguardBouncer(  855): show(authenticated = false) is called.
W/System.err(  855): java.lang.Throwable: stack dump
W/System.err(  855):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  855):    at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:91)
W/System.err(  855):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(StatusBarKeyguardViewManager.java:134)
W/System.err(  855):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:334)
W/System.err(  855):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:326)
W/System.err(  855):    at com.android.systemui.statusbar.phone.PhoneStatusBar.showBouncer(PhoneStatusBar.java:3888)
W/System.err(  855):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2564)
W/System.err(  855):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  855):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  855):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)

を使用していてもextended grep一致しませんが、makeExpandedInvisible他のパターンはうまく動作します。


編集する

マッチ -

 grep -A 25 -E 'show\(authenticated = |onAllPanelsCollapsed\(\)|makeExpandedInvisible'

はい

D/KeyguardBouncer(  850): show(authenticated = false) is called.
D/KeyguardBouncer(  850): show(authenticated = false) is called.
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:91)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(StatusBarKeyguardViewManager.java:134)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:334)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:326)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.showBouncer(PhoneStatusBar.java:3888)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.onTrackingStopped(PhoneStatusBar.java:3953)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView.onTrackingStopped(PhoneStatusBarView.java:164)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.onTrackingStopped(PanelView.java:373)
W/System.err(  850):    at com.android.systemui.statusbar.phone.NotificationPanelView.onTrackingStopped(NotificationPanelView.java:1492)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.onTouchEvent(PanelView.java:340)
W/System.err(  850):    at com.android.systemui.statusbar.phone.NotificationPanelView.onTouchEvent(NotificationPanelView.java:649)
W/System.err(  850):    at android.view.View.dispatchTouchEvent(View.java:8486)
W/System.err(  850):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2535)
W/System.err(  850):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2220)
W/System.err(  850):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2541)
W/System.err(  850):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2234)
W/System.err(  850):    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2541)
W/System.err(  850):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2234)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarWindowView.dispatchTouchEvent(StatusBarWindowView.java:175)
W/System.err(  850):    at android.view.View.dispatchPointerEvent(View.java:8687)
W/System.err(  850):    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4485)
W/System.err(  850):    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4343)
W/System.err(  850):    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3884)
--
I/PhoneStatusBarView(  850): onAllPanelsCollapsed()
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView.onAllPanelsCollapsed(PhoneStatusBarView.java:116)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelBar.panelExpansionChanged(PanelBar.java:191)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView.panelExpansionChanged(PhoneStatusBarView.java:180)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.notifyBarPanelExpansionChanged(PanelView.java:898)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.setExpandedHeightInternal(PanelView.java:639)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView$10.onAnimationUpdate(PanelView.java:891)
W/System.err(  850):    at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1283)
W/System.err(  850):    at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1207)
W/System.err(  850):    at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1248)
W/System.err(  850):    at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:659)
W/System.err(  850):    at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
--
I/PhoneStatusBar(  850): makeExpandedInvisible
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2528)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
I/PanelView(  850): setExpandedHeight(): height: 0.0
I/PanelView(  850): setExpandedHeightInternal(): height: 0.0
D/PanelBar(  850): panelExpansionChanged: start state=0 panel=null
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelBar.panelExpansionChanged(PanelBar.java:164)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView.panelExpansionChanged(PhoneStatusBarView.java:180)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.notifyBarPanelExpansionChanged(PanelView.java:898)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.setExpandedHeightInternal(PanelView.java:639)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.setExpandedHeight(PanelView.java:588)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.setExpandedFraction(PanelView.java:665)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelBar.collapseAllPanels(PanelBar.java:209)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2534)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
D/PanelBar(  850): panelExpansionChanged: end state=0 [ fullyClosed ]
D/PanelBar(  850): panelExpansionChanged: start state=0 panel=null
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelBar.panelExpansionChanged(PanelBar.java:164)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView.panelExpansionChanged(PhoneStatusBarView.java:180)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.notifyBarPanelExpansionChanged(PanelView.java:898)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelView.cancelPeek(PanelView.java:748)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PanelBar.collapseAllPanels(PanelBar.java:211)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2534)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
D/PanelBar(  850): panelExpansionChanged: end state=0 [ fullyClosed ]
D/StatusBarKeyguardViewManager(  850): dismiss(authenticated = false) is called. mScreenOn = true
D/KeyguardBouncer(  850): show(authenticated = false) is called.
D/KeyguardBouncer(  850): show(authenticated = false) is called.
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:91)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(StatusBarKeyguardViewManager.java:134)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:334)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:326)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.showBouncer(PhoneStatusBar.java:3888)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2564)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
D/KeyguardViewBase(  850): show()
D/KeyguardViewBase(  850): KeyguardViewBase.show()
W/System.err(  850): java.lang.Throwable: stack dump
W/System.err(  850):    at java.lang.Thread.dumpStack(Thread.java:490)
W/System.err(  850):    at com.android.keyguard.KeyguardViewBase.show(KeyguardViewBase.java:131)
W/System.err(  850):    at com.android.systemui.statusbar.phone.KeyguardBouncer.show(KeyguardBouncer.java:97)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.showBouncer(StatusBarKeyguardViewManager.java:134)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:334)
W/System.err(  850):    at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.dismiss(StatusBarKeyguardViewManager.java:326)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.showBouncer(PhoneStatusBar.java:3888)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBar.makeExpandedInvisible(PhoneStatusBar.java:2564)
W/System.err(  850):    at com.android.systemui.statusbar.phone.PhoneStatusBarView$1.run(PhoneStatusBarView.java:121)
W/System.err(  850):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:795)
W/System.err(  850):    at android.view.Choreographer.doCallbacks(Choreographer.java:598)
W/System.err(  850):    at android.view.Choreographer.doFrame(Choreographer.java:566)
W/System.err(  850):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:781)
W/System.err(  850):    at android.os.Handler.handleCallback(Handler.java:810)
W/System.err(  850):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(  850):    at android.os.Looper.loop(Looper.java:189)
W/System.err(  850):    at android.app.ActivityThread.main(ActivityThread.java:5532)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(  850):    at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(  850):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:950)
W/System.err(  850):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
D/KeyguardSecurityModel(  850): isPinPukOrMeRequiredOfSubId() - simState = ABSENT
D/KeyguardSecurityModel(  850): isPinPukOrMeRequiredOfSubId() - simState = ABSENT
D/AntiTheftManager(  850): getCurrentAntiTheftMode() is called.
D/KeyguardSecurityModel(  850): getSecurityMode() - PW_Quality = 65536
D/LockPatternUtilsCache(  850): havePattern() - cache = true
D/LockPatternUtils(  850): s=true ,L=true ,q=true ,v=false
D/LockPatternUtilsCache(  850): havePattern() - cache = true
V/KeyguardSecurityContainer(  850): showPrimarySecurityScreen(turningOff=false)
D/KeyguardSecurityContainer(  850): showSecurityScreen(Pattern)
D/KeyguardSecurityModel(  850): isPinPukOrMeRequiredOfSubId() - simState = ABSENT
D/KeyguardSecurityModel(  850): isPinPukOrMeRequiredOfSubId() - simState = ABSENT
D/AntiTheftManager(  850): getCurrentAntiTheftMode() is called.

ご覧のとおり、一致はたくさんありますが、以下をmakeExpandedInvisible含む行に対してのみ一致が必要です。

I/PhoneStatusBar(  850): makeExpandedInvisible

つまり、makeExpandedInvisible行末でいいえ他の行にはmakeExpandedInvisible


お問い合わせ

grep -A 25 -E 'show\(authenticated = |onAllPanelsCollapsed\(\)|makeExpandedInvisible$'

動作しません。

それでも-A 25問題にはなりません。ログは大きいので、一部だけを含めました。

ベストアンサー1

グループ内のすべてのモードを使用します。

grep -A 25 -E '(show\(authenticated = |onAllPanelsCollapsed\(\)|makeExpandedInvisible)$'

を使用してパターンをグループ化するため、パターン()は全体として処理され、これは行の末尾にある3つのパターンのうちの1つと一致します。

以前は、コマンドでgrep -A 25 -E 'show\(authenticated = |onAllPanelsCollapsed\(\)|makeExpandedInvisible$'3つのパターンを個別に処理しました。つまり、行のどこからでも行末show\(authenticated =でのみ処理しました。onAllPanelsCollapsed\(\)makeExpandedInvisible

その結果、show\(authenticated =どこにでも一致するonAllPanelsCollapsed\(\)か、makeExpandedInvisible行末で一致します。

おすすめ記事