[issue31574] Add dtrace hook for importlib

2017-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Merged. Thanks! ✨ 🍰 ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3d2b407da048b14ba6e5eb6079722a785d210590 by Łukasz Langa 
(Christian Heimes) in branch 'master':
bpo-31574: importlib dtrace (#3749)
https://github.com/python/cpython/commit/3d2b407da048b14ba6e5eb6079722a785d210590


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-29 Thread Łukasz Langa

Łukasz Langa  added the comment:

Amazing!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Christian Heimes added the comment:

Improved script and output for "import asyncio":

$ sudo stap import.stp -c "./python -c 'import asyncio'"
[1506343527655342994] * Importing '_frozen_importlib_external' ...
[1506343527655797118] + Imported  '_frozen_importlib_external' in 454us
[1506343527656351387] * Importing 'zipimport' ...
[1506343527656420328] + Imported  'zipimport' in 68us
[1506343527656577490] * Importing 'encodings' ...
[1506343527656969001]   * Importing 'codecs' ...
[1506343527657242647] * Importing '_codecs' ...
[1506343527657302163] + Imported  '_codecs' in 59us
[1506343527657461354]   + Imported  'codecs' in 492us
[1506343527657475610]   * Importing 'encodings.aliases' ...
[1506343527657778342]   + Imported  'encodings.aliases' in 302us
[1506343527657815834] + Imported  'encodings' in 1238us
[1506343527657829245] * Importing 'encodings.utf_8' ...
[1506343527658013466] + Imported  'encodings.utf_8' in 184us
[1506343527658037373] * Importing '_signal' ...
[1506343527658133293] + Imported  '_signal' in 95us
[1506343527658144146] * Importing 'encodings.latin_1' ...
[1506343527658350574] + Imported  'encodings.latin_1' in 206us
[1506343527658357616] * Importing 'io' ...
[1506343527658456592]   * Importing 'abc' ...
[1506343527658570293] * Importing '_weakrefset' ...
[1506343527658790316] + Imported  '_weakrefset' in 219us
[1506343527658881770]   + Imported  'abc' in 425us
[1506343527659074176] + Imported  'io' in 716us
[1506343527659130999] * Importing 'site' ...
[1506343527659303251]   * Importing 'os' ...
[1506343527659525410] * Importing 'errno' ...
[1506343527659597020] + Imported  'errno' in 71us
[1506343527659599466] * Importing 'stat' ...
[1506343527659766912]   * Importing '_stat' ...
[1506343527659826033]   + Imported  '_stat' in 59us
[1506343527659850009] + Imported  'stat' in 250us
[1506343527659890059] * Importing 'posixpath' ...
[1506343527660042891]   * Importing 'genericpath' ...
[1506343527660162920]   + Imported  'genericpath' in 119us
[1506343527660178776] + Imported  'posixpath' in 288us
[1506343527660291984] * Importing '_collections_abc' ...
[1506343527661557288] + Imported  '_collections_abc' in 1265us
[1506343527661673583]   + Imported  'os' in 2370us
[1506343527661677360]   * Importing '_sitebuiltins' ...
[1506343527661838265]   + Imported  '_sitebuiltins' in 160us
[1506343527662126078]   * Importing 'sitecustomize' ...
[1506343527662277259]   - Failed'sitecustomize' in 151us
[1506343527662281831]   * Importing 'usercustomize' ...
[1506343527662342158]   - Failed'usercustomize' in 60us
[1506343527662352810] + Imported  'site' in 3221us
[1506343527662533328] * Importing 'asyncio' ...
[1506343527662726586]   * Importing 'asyncio.selectors' ...
[1506343527662819261]   - Failed'asyncio.selectors' in 92us
[1506343527662828182]   * Importing 'selectors' ...
[1506343527662998225] * Importing 'collections' ...
[1506343527663394147]   * Importing 'operator' ...
[1506343527663966898] * Importing '_operator' ...
[1506343527664053199] + Imported  '_operator' in 86us
[1506343527664080513]   + Imported  'operator' in 686us
[1506343527664084065]   * Importing 'keyword' ...
[1506343527664212162]   + Imported  'keyword' in 128us
[1506343527664217270]   * Importing 'heapq' ...
[1506343527664344952] * Importing '_heapq' ...
[1506343527664482616] + Imported  '_heapq' in 137us
[1506343527664500526]   + Imported  'heapq' in 283us
[1506343527664504388]   * Importing 'itertools' ...
[1506343527664598920]   + Imported  'itertools' in 94us
[1506343527664603801]   * Importing 'reprlib' ...
[1506343527664775143]   + Imported  'reprlib' in 171us
[1506343527664779385]   * Importing '_collections' ...
[1506343527664845585]   + Imported  '_collections' in 66us
[1506343527665283918] + Imported  'collections' in 2285us
[1506343527665287954] * Importing 'collections.abc' ...
[1506343527665431913] + Imported  'collections.abc' in 143us
[1506343527665435709] * Importing 'math' ...
[1506343527665598221] + Imported  'math' in 162us
[1506343527665600676] * Importing 'select' ...
[1506343527665748069] + Imported  'select' in 147us
[1506343527666097689]   + Imported  'selectors' in 3269us
[1506343527666102503]   * Importing 'asyncio.base_events' ...
[1506343527666436554] * Importing 'concurrent.futures' ...
[1506343527666449899]   * Importing 'concurrent' ...
[1506343527666575660]   + Imported  'concurrent' in 125us
[150634352796868]   * Importing 'concurrent.futures._base' ...
[1506343527666880942] * Importing 'logging' ...
[1506343527667272107]   * Importing 'time' ...
[1506343527667364105]   + Imported  'time' in 91us
[1506343527667366876]   * Importing 'traceback' ...
[1506343527667538062] * Importing 'linecache' ...
[1506343527667655837]   * Impo

[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Christian Heimes added the comment:

Example output:

$ sudo stap import.stp -c "./python -c pass"
[1506342342142233574] * Importing '_frozen_importlib_external' ...
[1506342342142719538] + Imported  '_frozen_importlib_external'
[1506342342143260191] * Importing 'zipimport' ...
[1506342342143329476] + Imported  'zipimport'
[1506342342143474571] * Importing 'encodings' ...
[1506342342143858228]   * Importing 'codecs' ...
[1506342342144149624] * Importing '_codecs' ...
[1506342342144205933] + Imported  '_codecs'
[1506342342144363609]   + Imported  'codecs'
[1506342342144377843]   * Importing 'encodings.aliases' ...
[1506342342144676180]   + Imported  'encodings.aliases'
[1506342342144712610] + Imported  'encodings'
[1506342342144725110] * Importing 'encodings.utf_8' ...
[1506342342144906782] + Imported  'encodings.utf_8'
[1506342342144925714] * Importing '_signal' ...
[1506342342145015138] + Imported  '_signal'
[1506342342145025346] * Importing 'encodings.latin_1' ...
[1506342342145229859] + Imported  'encodings.latin_1'
[1506342342145236273] * Importing 'io' ...
[1506342342145333476]   * Importing 'abc' ...
[1506342342145443604] * Importing '_weakrefset' ...
[1506342342145658942] + Imported  '_weakrefset'
[1506342342145746442]   + Imported  'abc'
[1506342342145929972] + Imported  'io'
[1506342342145985754] * Importing 'site' ...
[1506342342146168933]   * Importing 'os' ...
[1506342342146387697] * Importing 'errno' ...
[1506342342146455581] + Imported  'errno'
[1506342342146457808] * Importing 'stat' ...
[1506342342146620691]   * Importing '_stat' ...
[1506342342146676954]   + Imported  '_stat'
[1506342342146700059] + Imported  'stat'
[1506342342146738715] * Importing 'posixpath' ...
[1506342342146882603]   * Importing 'genericpath' ...
[1506342342146999370]   + Imported  'genericpath'
[1506342342147014839] + Imported  'posixpath'
[1506342342147133401] * Importing '_collections_abc' ...
[1506342342148404142] + Imported  '_collections_abc'
[1506342342148517849]   + Imported  'os'
[1506342342148521360]   * Importing '_sitebuiltins' ...
[1506342342148680131]   + Imported  '_sitebuiltins'
[1506342342148952120]   * Importing 'sitecustomize' ...
[1506342342149107151]   - Failed'sitecustomize'
[1506342342149111461]   * Importing 'usercustomize' ...
[1506342342149171745]   - Failed'usercustomize'
[1506342342149182576] + Imported  'site'

--
Added file: https://bugs.python.org/file47168/import.stp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

Changes by Christian Heimes :


--
keywords: +patch
pull_requests: +3736
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31574] Add dtrace hook for importlib

2017-09-25 Thread Christian Heimes

New submission from Christian Heimes:

#31415 proposed an option to show import timings. The output is primarily 
designed for humans. I propose to instrument importlib with two dtrace hooks:

  probe import__find__load__start(const char *)
  probe import__find__load__done(const char *, int);

arg0 is the absolute module name as UTF-8 string. arg1 of import_find_load_done 
probe indicates if the module was found (1) or import failed (0).

--
components: Interpreter Core
messages: 302942
nosy: brett.cannon, christian.heimes, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Add dtrace hook for importlib
type: performance
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com