Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
21a7d8c7
Commit
21a7d8c7
authored
3 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Include profiling information in --debug output if --profile is not set.
parent
ee10baf8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/profiling.py
+9
-6
9 additions, 6 deletions
diffoscope/profiling.py
with
9 additions
and
6 deletions
diffoscope/profiling.py
+
9
−
6
View file @
21a7d8c7
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016-2017, 2019-202
0
Chris Lamb <lamby@debian.org>
# Copyright © 2016-2017, 2019-202
1
Chris Lamb <lamby@debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -22,6 +22,7 @@ import contextlib
import
collections
from
.utils
import
format_class
from
.logging
import
setup_logging
_ENABLED
=
False
...
...
@@ -50,7 +51,7 @@ class ProfileManager:
def
setup
(
self
,
parsed_args
):
global
_ENABLED
_ENABLED
=
parsed_args
.
profile_output
is
not
None
_ENABLED
=
parsed_args
.
profile_output
is
not
None
or
parsed_args
.
debug
def
increment
(
self
,
start
,
namespace
,
key
):
if
not
isinstance
(
key
,
str
):
...
...
@@ -62,11 +63,13 @@ class ProfileManager:
def
finish
(
self
,
parsed_args
):
from
.presenters.utils
import
make_printer
# Include profiling in --debug output if --profile is not set.
if
parsed_args
.
profile_output
is
None
:
return
with
make_printer
(
parsed_args
.
profile_output
)
as
fn
:
self
.
output
(
fn
)
with
setup_logging
(
parsed_args
.
debug
,
None
)
as
logger
:
self
.
output
(
lambda
x
:
logger
.
debug
(
x
.
strip
(
"
\n
"
)))
else
:
with
make_printer
(
parsed_args
.
profile_output
)
as
fn
:
self
.
output
(
fn
)
def
output
(
self
,
print_fn
):
title
=
"
# Profiling output for: {}
"
.
format
(
"
"
.
join
(
sys
.
argv
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment