view_profile.py 857 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/python
  2. # This file is part of TRS (http://math.kompiler.org)
  3. #
  4. # TRS is free software: you can redistribute it and/or modify it under the
  5. # terms of the GNU Affero General Public License as published by the Free
  6. # Software Foundation, either version 3 of the License, or (at your option) any
  7. # later version.
  8. #
  9. # TRS is distributed in the hope that it will be useful, but WITHOUT ANY
  10. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  12. # details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with TRS. If not, see <http://www.gnu.org/licenses/>.
  16. import sys
  17. from pstats import Stats
  18. s = Stats(sys.argv[1])
  19. for profile in sys.argv[2:]:
  20. s.add(profile)
  21. s.sort_stats('cumulative')
  22. s.print_stats()