[pypy-commit] pypy vmprof-0.4.8: missing vmprof_ prefix

2017-06-07 Thread plan_rich
Author: Richard Plangger 
Branch: vmprof-0.4.8
Changeset: r91557:876d67108576
Date: 2017-06-07 06:58 -0400
http://bitbucket.org/pypy/pypy/changeset/876d67108576/

Log:missing vmprof_ prefix

diff --git a/pypy/module/_vmprof/interp_vmprof.py 
b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -98,8 +98,8 @@
 return space.newtext(path)
 
 def stop_sampling(space):
-return space.newint(rvmprof.stop_sampling(space))
+return space.newint(rvmprof.vmprof_stop_sampling(space))
 
 def start_sampling(space):
-rvmprof.start_sampling(space)
+rvmprof.vmprof_start_sampling(space)
 return space.w_None
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Tweak to also report the single largest objects

2017-06-07 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r91558:7f9ffd5232c6
Date: 2017-06-07 13:05 +0200
http://bitbucket.org/pypy/pypy/changeset/7f9ffd5232c6/

Log:Tweak to also report the single largest objects

diff --git a/pypy/tool/gcdump.py b/pypy/tool/gcdump.py
--- a/pypy/tool/gcdump.py
+++ b/pypy/tool/gcdump.py
@@ -13,10 +13,12 @@
 class Stat(object):
 summary = {}
 typeids = {0: ''}
+BIGOBJ = 65536   # bytes
 
 def summarize(self, filename):
 a = self.load_dump_file(filename)
 self.summary = {} # {typenum: [count, totalsize]}
+self.bigobjs = [] # list of individual (size, typenum)
 for obj in self.walk(a):
 self.add_object_summary(obj[2], obj[3])
 
@@ -50,6 +52,18 @@
 print '%8d %8.2fM  %s' % (stat[0], stat[1] / (1024.0*1024.0),
   self.get_type_name(typenum))
 print 'total %.1fM' % (totalsize / (1024.0*1024.0),)
+print
+lst = sorted(self.bigobjs)[-10:]
+if lst:
+if len(lst) == len(self.bigobjs):
+print '%d objects take at least %d bytes each:' % (len(lst), 
self.BIGOBJ)
+else:
+print '%d largest single objects:' % (len(lst),)
+for size, typenum in lst:
+print '%8s %8.2fM  %s' % ('', size / (1024.0*1024.0),
+  self.get_type_name(typenum))
+else:
+print 'No object takes at least %d bytes on its own.' % 
(self.BIGOBJ,)
 
 def load_dump_file(self, filename):
 f = open(filename, 'rb')
@@ -62,6 +76,8 @@
 return a
 
 def add_object_summary(self, typenum, sizeobj):
+if sizeobj >= self.BIGOBJ:
+self.bigobjs.append((sizeobj, typenum))
 try:
 stat = self.summary[typenum]
 except KeyError:
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy vmprof-0.4.8: added prefix vmprof_ to wrong callsite

2017-06-07 Thread plan_rich
Author: Richard Plangger 
Branch: vmprof-0.4.8
Changeset: r91559:ba7e4af9836a
Date: 2017-06-07 07:05 -0400
http://bitbucket.org/pypy/pypy/changeset/ba7e4af9836a/

Log:added prefix vmprof_ to wrong callsite

diff --git a/pypy/module/_vmprof/interp_vmprof.py 
b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -98,8 +98,8 @@
 return space.newtext(path)
 
 def stop_sampling(space):
-return space.newint(rvmprof.vmprof_stop_sampling(space))
+return space.newint(rvmprof.stop_sampling(space))
 
 def start_sampling(space):
-rvmprof.vmprof_start_sampling(space)
+rvmprof.start_sampling(space)
 return space.w_None
diff --git a/rpython/rlib/rvmprof/__init__.py b/rpython/rlib/rvmprof/__init__.py
--- a/rpython/rlib/rvmprof/__init__.py
+++ b/rpython/rlib/rvmprof/__init__.py
@@ -56,8 +56,8 @@
 return None
 
 def stop_sampling(space):
-fd = _get_vmprof().cintf.stop_sampling()
+fd = _get_vmprof().cintf.vmprof_stop_sampling()
 return rffi.cast(lltype.Signed, fd)
 
 def start_sampling(space):
-_get_vmprof().cintf.start_sampling()
+_get_vmprof().cintf.vmprof_start_sampling()
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Added tag release-pypy2.7-v5.8.0 for changeset c925e7381036

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91560:8e0f40a44beb
Date: 2017-06-07 16:19 +0300
http://bitbucket.org/pypy/pypy/changeset/8e0f40a44beb/

Log:Added tag release-pypy2.7-v5.8.0 for changeset c925e7381036

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -38,3 +38,4 @@
 b16a4363e930f6401bceb499b9520955504c6cb0 release-pypy3.5-v5.7.0
 1aa2d8e03cdfab54b7121e93fda7e98ea88a30bf release-pypy2.7-v5.7.1
 2875f328eae2216a87f3d6f335092832eb031f56 release-pypy3.5-v5.7.1
+c925e73810367cd960a32592dd7f728f436c125c release-pypy2.7-v5.8.0
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Added tag release-pypy3.5-v5.8.0 for changeset a37ecfe5f142

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91561:d17da6177617
Date: 2017-06-07 16:20 +0300
http://bitbucket.org/pypy/pypy/changeset/d17da6177617/

Log:Added tag release-pypy3.5-v5.8.0 for changeset a37ecfe5f142

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -39,3 +39,4 @@
 1aa2d8e03cdfab54b7121e93fda7e98ea88a30bf release-pypy2.7-v5.7.1
 2875f328eae2216a87f3d6f335092832eb031f56 release-pypy3.5-v5.7.1
 c925e73810367cd960a32592dd7f728f436c125c release-pypy2.7-v5.8.0
+a37ecfe5f142bc971a86d17305cc5d1d70abec64 release-pypy3.5-v5.8.0
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: repackage script - mroe robust and quieter, check hg hash, refactor for 2.7/3.5

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91562:a0bfbbf2ecb2
Date: 2017-06-07 17:14 +0300
http://bitbucket.org/pypy/pypy/changeset/a0bfbbf2ecb2/

Log:repackage script - mroe robust and quieter, check hg hash, refactor
for 2.7/3.5

diff --git a/pypy/tool/release/repackage.sh b/pypy/tool/release/repackage.sh
--- a/pypy/tool/release/repackage.sh
+++ b/pypy/tool/release/repackage.sh
@@ -1,24 +1,44 @@
 # Edit these appropriately before running this script
+pmaj=2  # python main version
+pmin=7  # python minor version
 maj=5
-min=7
-rev=1
-branchname=release-pypy2.7-5.x # ==OR== release-$maj.x  # ==OR== 
release-$maj.$min.x
-tagname=release-pypy2.7-v$maj.$min.$rev  # ==OR== release-$maj.$min
+min=8
+rev=0
+branchname=release-pypy$pmaj.$pmin-$maj.x # ==OR== release-$maj.x  # ==OR== 
release-$maj.$min.x
+tagname=release-pypy$pmaj.$pmin-v$maj.$min.$rev  # ==OR== release-$maj.$min
 
 echo checking hg log -r $branchname
 hg log -r $branchname || exit 1
 echo checking hg log -r $tagname
 hg log -r $tagname || exit 1
+hgrev=`hg id -r $tagname -i`
 
-rel=pypy2-v$maj.$min.$rev
-# This script will download latest builds from the buildmaster, rename the top
-# level directory, and repackage ready to be uploaded to bitbucket. It will 
also
-# download source, assuming a tag for the release already exists, and 
repackage them.
-# The script should be run in an empty directory, i.e. /tmp/release_xxx
+rel=pypy$pmaj-v$maj.$min.$rev
+# The script should be run in an empty in the pypy tree, i.e. pypy/tmp
+if [ "`ls . | wc -l`" != "0" ]
+then
+echo this script must be run in an empty directory
+exit -1
+fi
+
+# Download latest builds from the buildmaster, rename the top
+# level directory, and repackage ready to be uploaded to bitbucket
 for plat in linux linux64 linux-armhf-raspbian linux-armhf-raring linux-armel 
osx64 s390x
   do
 echo downloading package for $plat
-wget 
http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2
+if wget -q --show-progress 
http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.tar.bz2
+then
+echo $plat downloaded 
+else
+echo $plat no download available
+continue
+fi
+hgcheck=`tar -tf pypy-c-jit-latest-$plat.tar.bz2 |head -n1 | cut -d- -f5`
+if [ "$hgcheck" != "$hgrev" ]
+then
+echo $plat hg tag mismatch, expected $hgrev, got $hgcheck
+continue
+fi
 tar -xf pypy-c-jit-latest-$plat.tar.bz2
 rm pypy-c-jit-latest-$plat.tar.bz2
 plat_final=$plat
@@ -32,23 +52,31 @@
   done
 
 plat=win32
-wget http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.zip
-unzip pypy-c-jit-latest-$plat.zip
-rm pypy-c-jit-latest-$plat.zip
-mv pypy-c-jit-*-$plat $rel-$plat
-zip -rq $rel-$plat.zip $rel-$plat
-rm -rf $rel-$plat
+if wget 
http://buildbot.pypy.org/nightly/$branchname/pypy-c-jit-latest-$plat.zip
+then
+unzip -q pypy-c-jit-latest-$plat.zip
+rm pypy-c-jit-latest-$plat.zip
+mv pypy-c-jit-*-$plat $rel-$plat
+zip -rq $rel-$plat.zip $rel-$plat
+rm -rf $rel-$plat
+else
+echo no download for $plat
+fi
 
+# Download source and repackage
 # Requires a valid $tagname, note the untarred directory is pypy-pypy-
 # so make sure there is not another one
-wget https://bitbucket.org/pypy/pypy/get/$tagname.tar.bz2
-tar -xf $tagname.tar.bz2
-rm $tagname.tar.bz2
-mv pypy-pypy-* $rel-src
-tar --owner=root --group=root --numeric-owner -cjf $rel-src.tar.bz2 $rel-src
-zip -rq $rel-src.zip $rel-src
-rm -rf $rel-src
-
+if wget https://bitbucket.org/pypy/pypy/get/$tagname.tar.bz2
+then
+tar -xf $tagname.tar.bz2
+rm $tagname.tar.bz2
+mv pypy-pypy-* $rel-src
+tar --owner=root --group=root --numeric-owner -cjf $rel-src.tar.bz2 
$rel-src
+zip -rq $rel-src.zip $rel-src
+rm -rf $rel-src
+else
+echo source tarfile for $tagname not found on bitbucket, did you push the 
tag commit?
+fi
 # Print out the md5, sha1, sha256
 #md5sum *.bz2 *.zip
 #sha1sum *.bz2 *.zip
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: copy packaging explaination from www.pypy.org to documentation

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91563:197b78d9963b
Date: 2017-06-07 17:35 +0300
http://bitbucket.org/pypy/pypy/changeset/197b78d9963b/

Log:copy packaging explaination from www.pypy.org to documentation

diff --git a/pypy/doc/build.rst b/pypy/doc/build.rst
--- a/pypy/doc/build.rst
+++ b/pypy/doc/build.rst
@@ -195,6 +195,29 @@
 ``/tmp/usession-YOURNAME/build/``.  You can then either move the file
 hierarchy or unpack the ``.tar.bz2`` at the correct place.
 
+It is recommended to use package.py because custom scripts will
+invariably become out-of-date.  If you want to write custom scripts
+anyway, note an easy-to-miss point: some modules are written with CFFI,
+and require some compilation.  If you install PyPy as root without
+pre-compiling them, normal users will get errors:
+
+* PyPy 2.5.1 or earlier: normal users would see permission errors.
+  Installers need to run ``pypy -c "import gdbm"`` and other similar
+  commands at install time; the exact list is in `package.py`_.  Users
+  seeing a broken installation of PyPy can fix it after-the-fact if they
+  have sudo rights, by running once e.g. ``sudo pypy -c "import gdbm``.
+
+* PyPy 2.6 and later: anyone would get ``ImportError: no module named
+  _gdbm_cffi``.  Installers need to run ``pypy _gdbm_build.py`` in the
+  ``lib_pypy`` directory during the installation process (plus others;
+  see the exact list in `package.py`_).  Users seeing a broken
+  installation of PyPy can fix it after-the-fact, by running ``pypy
+  /path/to/lib_pypy/_gdbm_build.py``.  This command produces a file
+  called ``_gdbm_cffi.pypy-41.so`` locally, which is a C extension
+  module for PyPy.  You can move it at any place where modules are
+  normally found: e.g. in your project's main directory, or in a
+  directory that you add to the env var ``PYTHONPATH``.
+
 
 Installation
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy vmprof-0.4.8: close branch

2017-06-07 Thread plan_rich
Author: Richard Plangger 
Branch: vmprof-0.4.8
Changeset: r91565:eaaa49735879
Date: 2017-06-07 10:38 -0400
http://bitbucket.org/pypy/pypy/changeset/eaaa49735879/

Log:close branch

___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy.org extradoc: update for 5.8.0, leave 5.7 hashes for now

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: extradoc
Changeset: r886:344a346894fb
Date: 2017-06-07 17:36 +0300
http://bitbucket.org/pypy/pypy.org/changeset/344a346894fb/

Log:update for 5.8.0, leave 5.7 hashes for now

diff --git a/source/download.txt b/source/download.txt
--- a/source/download.txt
+++ b/source/download.txt
@@ -15,14 +15,14 @@
 We provide binaries for x86, ARM, PPC and s390x running on different operating 
systems such as
 Linux, Mac OS X and Windows:
 
-* the Python2.7 compatible release — **PyPy2.7 v5.7.1** — (`what's 
new in PyPy2.7?`_)
+* the Python2.7 compatible release — **PyPy2.7 v5.8.0** — (`what's 
new in PyPy2.7?`_)
 
-* the Python3.5 compatible beta quality release — **PyPy3.5 v5.7.1** 
— (`what's new in PyPy3.5?`_).
+* the Python3.5 compatible beta quality release — **PyPy3.5 v5.8.0** 
— (`what's new in PyPy3.5?`_).
 
 * the Python2.7 Software Transactional Memory special release — 
**PyPy-STM 2.5.1** (Linux x86-64 only)
 
-.. _what's new in PyPy2.7?: http://doc.pypy.org/en/latest/release-v5.7.1.html
-.. _what's new in PyPy3.5?: http://doc.pypy.org/en/latest/release-v5.7.1.html
+.. _what's new in PyPy2.7?: http://doc.pypy.org/en/latest/release-v5.8.0.html
+.. _what's new in PyPy3.5?: http://doc.pypy.org/en/latest/release-v5.8.0.html
 
 
 .. class:: download_menu
@@ -79,7 +79,7 @@
 
 .. _release:
 
-Python2.7 compatible PyPy 5.7.1
+Python2.7 compatible PyPy 5.8.0
 ---
 
 * `Linux x86 binary (32bit, tar.bz2 built on Ubuntu 12.04 - 14.04)`__ (see 
``[1]`` below)
@@ -98,24 +98,24 @@
 * `All our downloads,`__ including previous versions.  We also have a
   mirror_, but please use only if you have troubles accessing the links above
 
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux32.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux64.tar.bz2
-.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux-armhf-raspbian.tar.bz2
-.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux-armhf-raring.tar.bz2
-.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-linux-armel.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-osx64.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-win32.zip
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-ppc64.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-ppc64le.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-s390x.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-src.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.7.1-src.zip
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux32.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux64.tar.bz2
+.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux-armhf-raspbian.tar.bz2
+.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux-armhf-raring.tar.bz2
+.. __: 
https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-linux-armel.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-osx64.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-win32.zip
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-ppc64.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-ppc64le.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-s390x.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-src.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-src.zip
 .. _`vcredist_x86.exe`: 
http://www.microsoft.com/en-us/download/details.aspx?id=5582
 .. __: https://bitbucket.org/pypy/pypy/downloads
 .. _mirror: http://buildbot.pypy.org/mirror/
 .. _FreshPorts: http://www.freshports.org/lang/pypy
 
-Python 3.5.3 compatible PyPy3.5 v5.7
+Python 3.5.3 compatible PyPy3.5 v5.8
 
 
 .. class:: download_menu
@@ -131,9 +131,9 @@
 * `All our downloads,`__ including previous versions.  We also have a
   mirror_, but please use only if you have troubles accessing the links above
 
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.7.1-linux64.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.7.1-src.tar.bz2
-.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.7.1-src.zip
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.8.0-linux64.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.8.0-src.tar.bz2
+.. __: https://bitbucket.org/pypy/pypy/downloads/pypy3-v5.8.0-src.zip
 .. __: https://bitbucket.org/pypy/pypy/downloads
 
 If your CPU is really, really old, it may be a x86-32 without SSE2.
@@ -203,7 +203,7 @@
 uncompressed, they run in-place.  For now you can uncompress them
 either somewhere in your home directory or, say, in ``/opt``, and
 if you want, put a symlink from somewhere like
-``/usr/local/bin/pypy`` to ``/path/to/pypy2-5.7.1/bin/pypy``.

[pypy-commit] pypy default: merge branch vmprof-0.4.8

2017-06-07 Thread plan_rich
Author: Richard Plangger 
Branch: 
Changeset: r91564:1c08349b2ad3
Date: 2017-06-07 10:38 -0400
http://bitbucket.org/pypy/pypy/changeset/1c08349b2ad3/

Log:merge branch vmprof-0.4.8

diff --git a/pypy/module/_vmprof/__init__.py b/pypy/module/_vmprof/__init__.py
--- a/pypy/module/_vmprof/__init__.py
+++ b/pypy/module/_vmprof/__init__.py
@@ -14,6 +14,9 @@
 'write_all_code_objects': 'interp_vmprof.write_all_code_objects',
 'is_enabled': 'interp_vmprof.is_enabled',
 'get_profile_path': 'interp_vmprof.get_profile_path',
+'stop_sampling': 'interp_vmprof.stop_sampling',
+'start_sampling': 'interp_vmprof.start_sampling',
+
 'VMProfError': 'space.fromcache(interp_vmprof.Cache).w_VMProfError',
 }
 
diff --git a/pypy/module/_vmprof/interp_vmprof.py 
b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -96,3 +96,10 @@
 # Indicates an error! Assume platform does not implement the function 
call
 raise oefmt(space.w_NotImplementedError, "platform not implemented")
 return space.newtext(path)
+
+def stop_sampling(space):
+return space.newint(rvmprof.stop_sampling(space))
+
+def start_sampling(space):
+rvmprof.start_sampling(space)
+return space.w_None
diff --git a/rpython/rlib/rvmprof/__init__.py b/rpython/rlib/rvmprof/__init__.py
--- a/rpython/rlib/rvmprof/__init__.py
+++ b/rpython/rlib/rvmprof/__init__.py
@@ -3,13 +3,12 @@
 from rpython.rlib.rvmprof.rvmprof import vmprof_execute_code, MAX_FUNC_NAME
 from rpython.rlib.rvmprof.rvmprof import _was_registered
 from rpython.rlib.rvmprof.cintf import VMProfPlatformUnsupported
-from rpython.rtyper.lltypesystem import rffi
+from rpython.rtyper.lltypesystem import rffi, lltype
 
 #
 # See README.txt.
 #
 
-
 #vmprof_execute_code(): implemented directly in rvmprof.py
 
 def register_code_object_class(CodeClass, full_name_func):
@@ -56,3 +55,9 @@
 
 return None
 
+def stop_sampling(space):
+fd = _get_vmprof().cintf.vmprof_stop_sampling()
+return rffi.cast(lltype.Signed, fd)
+
+def start_sampling(space):
+_get_vmprof().cintf.vmprof_start_sampling()
diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -110,6 +110,12 @@
 vmprof_get_profile_path = rffi.llexternal("vmprof_get_profile_path", 
[rffi.CCHARP, lltype.Signed],
   lltype.Signed, 
compilation_info=eci,
   _nowrapper=True)
+vmprof_stop_sampling = rffi.llexternal("vmprof_stop_sampling", [],
+  rffi.INT, compilation_info=eci,
+  _nowrapper=True)
+vmprof_start_sampling = rffi.llexternal("vmprof_start_sampling", [],
+  lltype.Void, 
compilation_info=eci,
+  _nowrapper=True)
 
 return CInterface(locals())
 
diff --git a/rpython/rlib/rvmprof/src/rvmprof.c 
b/rpython/rlib/rvmprof/src/rvmprof.c
--- a/rpython/rlib/rvmprof/src/rvmprof.c
+++ b/rpython/rlib/rvmprof/src/rvmprof.c
@@ -30,8 +30,18 @@
 }
 #endif
 
-
 long vmprof_get_profile_path(const char * buffer, long size)
 {
 return vmp_fd_to_path(vmp_profile_fileno(), buffer, size);
 }
+
+int vmprof_stop_sampling(void)
+{
+vmprof_ignore_signals(1);
+return vmp_profile_fileno();
+}
+
+void vmprof_start_sampling(void)
+{
+vmprof_ignore_signals(0);
+}
diff --git a/rpython/rlib/rvmprof/src/rvmprof.h 
b/rpython/rlib/rvmprof/src/rvmprof.h
--- a/rpython/rlib/rvmprof/src/rvmprof.h
+++ b/rpython/rlib/rvmprof/src/rvmprof.h
@@ -38,6 +38,8 @@
 RPY_EXTERN void vmprof_stack_free(void*);
 RPY_EXTERN intptr_t vmprof_get_traceback(void *, void *, intptr_t*, intptr_t);
 RPY_EXTERN long vmprof_get_profile_path(const char *, long);
+RPY_EXTERN int vmprof_stop_sampling(void);
+RPY_EXTERN void vmprof_start_sampling(void);
 
 long vmprof_write_header_for_jit_addr(intptr_t *result, long n,
   intptr_t addr, int max_depth);
diff --git a/rpython/rlib/rvmprof/src/shared/_vmprof.c 
b/rpython/rlib/rvmprof/src/shared/_vmprof.c
--- a/rpython/rlib/rvmprof/src/shared/_vmprof.c
+++ b/rpython/rlib/rvmprof/src/shared/_vmprof.c
@@ -13,7 +13,6 @@
 static volatile int is_enabled = 0;
 static destructor Original_code_dealloc = 0;
 static PyObject* (*_default_eval_loop)(PyFrameObject *, int) = 0;
-void vmp_scan_profile(int fileno, int dump_native, void *all_code_uids);
 
 #if VMPROF_UNIX
 #include "trampoline.h"
@@ -82,15 +81,23 @@
 return vmprof_register_virtual_function(buf, CODE_ADDR_TO_UID(co), 50);
 }
 
-static int _look_for_code_object(PyObject *o, void *all_codes)
+static int _look_for_code_object(PyObject *o, void * param)
 {
-if (PyCode_Check(o) && !PySet_Contains((PyObject *)all_codes, o)) {
-Py_ssize_

[pypy-commit] pypy vmprof-0.4.8: document branch vmprof-0.4.8

2017-06-07 Thread plan_rich
Author: Richard Plangger 
Branch: vmprof-0.4.8
Changeset: r91566:9f8a7fe9894a
Date: 2017-06-07 10:41 -0400
http://bitbucket.org/pypy/pypy/changeset/9f8a7fe9894a/

Log:document branch vmprof-0.4.8

diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -9,3 +9,7 @@
 .. branch: cffi-char16-char32
 
 The two ``cffi-*`` branches are part of the upgrade to cffi 1.11.
+
+.. branch: vmprof-0.4.8
+
+Reduces the amount of C code needed to write native symbol information to the 
logfile.
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy.org extradoc: add 3.5 hashes

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: extradoc
Changeset: r887:9220a439ce17
Date: 2017-06-07 18:34 +0300
http://bitbucket.org/pypy/pypy.org/changeset/9220a439ce17/

Log:add 3.5 hashes

diff --git a/source/download.txt b/source/download.txt
--- a/source/download.txt
+++ b/source/download.txt
@@ -452,6 +452,12 @@
 ec1e34cc81a7f4086135bab29dcbe61d19fcd8d9d8fc1b149bea8373f94fd958  
pypy2-v5.8.0-src.zip
 43d6217653e5bdc09e3ff8cb56fb52c4eb019429063d80107be4e88eef79ea8d  
pypy2-v5.8.0-win32.zip
 
+pypy 3.5-v5.7.1 sha256::
+
+9d090127335c3c0fd2b14c8835bf91752e62756e55ea06aad3353f24a6854223  
pypy3-v5.8.0-src.tar.bz2
+bb62f469df2421f854606c4181e66c14c58945180d03773020a4baf9a81c9fb1  
pypy-c-jit-latest-linux64.tar.bz2
+8c868b5c8d15ce8acdf967f3c25da44bf52f6c7aa1fd1e50ebd50590f98066a4  
pypy3-v5.8.0-src.zip
+
 pypy2.7-v5.7.1 sha256::
 
 f125a227f8c814ba1698168a639ea6ca59bb69c280529639eed29076d8429a73  
pypy2-v5.7.1-linux32.tar.bz2
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: add more highlights to the top-level of the release notice (hopefully accurate?)

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91567:68056ea67737
Date: 2017-06-07 19:21 +0300
http://bitbucket.org/pypy/pypy/changeset/68056ea67737/

Log:add more highlights to the top-level of the release notice
(hopefully accurate?)

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -10,6 +10,12 @@
 This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
 PyPy3.5 includes the upstream stdlib version 3.5.3.
 
+We can now profile native frames in the vmprof_ statistical profiler, even in
+JITted code.
+
+The struct module functions `pack*` and `unpack*` are now much faster,
+especially on raw buffers and bytearrays.
+
 This release adds (but disables by default) link-time optimization and
 `profile guided optimization`_ of the base interpreter, which may make
 unjitted code run faster. To use these, translate with appropriate
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: Don't preallocate RPython lists if we only know an upper bound on

2017-06-07 Thread arigo
Author: Armin Rigo 
Branch: 
Changeset: r91568:6cbfa075de61
Date: 2017-06-07 18:47 +0200
http://bitbucket.org/pypy/pypy/changeset/6cbfa075de61/

Log:Don't preallocate RPython lists if we only know an upper bound on
the final size. See comments.

diff --git a/rpython/annotator/unaryop.py b/rpython/annotator/unaryop.py
--- a/rpython/annotator/unaryop.py
+++ b/rpython/annotator/unaryop.py
@@ -410,6 +410,7 @@
 self.listdef.resize()
 self.listdef.listitem.hint_maxlength = True
 elif 'fence' in hints:
+self.listdef.resize()
 self = self.listdef.offspring(getbookkeeper())
 return self
 
diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py
--- a/rpython/translator/simplify.py
+++ b/rpython/translator/simplify.py
@@ -1005,6 +1005,16 @@
 
 # - add a hint(vlist, iterable, {'maxlength'}) in the iterblock,
 #   where we can compute the known maximum length
+# - new in June 2017: we do that only if 'exactlength' is True.
+#   found some real use cases where the over-allocation scheme
+#   was over-allocating far too much: the loop would only append
+#   an item to the list after 'if some rare condition:'.  By
+#   dropping this hint, we disable preallocation and cause the
+#   append() to be done by checking the size, but still, after
+#   the loop, we will turn the list into a fixed-size one.
+#   ('maxlength_inexact' is never processed elsewhere; the hint
+#   is still needed to prevent this function from being entered
+#   in an infinite loop)
 link = iterblock.exits[0]
 vlist = self.contains_vlist(link.args)
 assert vlist
@@ -1014,7 +1024,8 @@
 break
 else:
 raise AssertionError("lost 'iter' operation")
-chint = Constant({'maxlength': True})
+chint = Constant({'maxlength' if exactlength else 'maxlength_inexact':
+  True})
 hint = op.hint(vlist, hlop.args[0], chint)
 iterblock.operations.append(hint)
 link.args = list(link.args)
diff --git a/rpython/translator/test/test_simplify.py 
b/rpython/translator/test/test_simplify.py
--- a/rpython/translator/test/test_simplify.py
+++ b/rpython/translator/test/test_simplify.py
@@ -336,11 +336,14 @@
 interp = LLInterpreter(t.rtyper)
 return interp, graph
 
-def no_resize(self, graph):
+def no_resize(self, graph, expect_resize=0):
+found_resize = 0
 for block in graph.iterblocks():
 for op in block.operations:
 if op.opname == 'direct_call':
-assert 'list_resize' not in repr(op.args[0])
+if 'list_resize' in repr(op.args[0]):
+found_resize += 1
+assert found_resize == expect_resize
 
 def test_simple(self):
 def main(n):
@@ -367,7 +370,8 @@
 interp, graph = self.specialize(main, [int])
 res = interp.eval_graph(graph, [10])
 assert res == 5
-self.no_resize(graph)
+self.no_resize(graph, expect_resize=1)
+# the non-exactness disables preallocating now, for sanity
 
 def test_mutated_after_listcomp(self):
 def main(n):
@@ -379,6 +383,7 @@
 assert res == 5 * 17
 res = interp.eval_graph(graph, [5])
 assert res == -42
+self.no_resize(graph, expect_resize=1)   # after the loop
 
 def test_two_loops(self):
 def main(n, m):
@@ -397,6 +402,7 @@
 interp, graph = self.specialize(main, [int, int])
 res = interp.eval_graph(graph, [8, 3])
 assert res == 28 - 3
+self.no_resize(graph)
 
 def test_dict(self):
 def main(n, m):
@@ -408,6 +414,7 @@
 assert res == 2 + 8 * 17 + 5 * 17
 res = interp.eval_graph(graph, [4, 4])
 assert res == 1 + 4 * 17 + 4 * 17
+self.no_resize(graph)
 
 
 def test_list_iterator(self):
@@ -452,3 +459,4 @@
 interp, graph = self.specialize(main, [int])
 res = interp.eval_graph(graph, [10])
 assert res == 5 * 17
+self.no_resize(graph)
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: mention Gambit and actual struct speed improvement

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91569:ad3681ed2701
Date: 2017-06-07 20:03 +0300
http://bitbucket.org/pypy/pypy/changeset/ad3681ed2701/

Log:mention Gambit and actual struct speed improvement

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -10,11 +10,12 @@
 This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
 PyPy3.5 includes the upstream stdlib version 3.5.3.
 
-We can now profile native frames in the vmprof_ statistical profiler, even in
-JITted code.
+We added native PyPy support to profile frames in the vmprof_ statistical
+profiler.
 
-The struct module functions `pack*` and `unpack*` are now much faster,
-especially on raw buffers and bytearrays.
+The `struct`` module functions `pack*` and `unpack*` are now much faster,
+especially on raw buffers and bytearrays. Microbenchmarks show a 2x to 10x
+speedup. Thanks to Gambit_ for sponsoring this work.
 
 This release adds (but disables by default) link-time optimization and
 `profile guided optimization`_ of the base interpreter, which may make
@@ -60,6 +61,7 @@
 .. _`help`: project-ideas.html
 .. _`options`: config/commandline.html#general-translation-options
 .. _`these benchmarks show`: 
https://morepypy.blogspot.com/2017/03/async-http-benchmarks-on-pypy3.html
+.. _Gambit: http://gambitresearch.com
 
 What is PyPy?
 =
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix the name of Gambit Research

2017-06-07 Thread antocuni
Author: Antonio Cuni 
Branch: 
Changeset: r91570:3873f54fed26
Date: 2017-06-07 19:09 +0200
http://bitbucket.org/pypy/pypy/changeset/3873f54fed26/

Log:fix the name of Gambit Research

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -15,7 +15,7 @@
 
 The `struct`` module functions `pack*` and `unpack*` are now much faster,
 especially on raw buffers and bytearrays. Microbenchmarks show a 2x to 10x
-speedup. Thanks to Gambit_ for sponsoring this work.
+speedup. Thanks to `Gambit Research`_ for sponsoring this work.
 
 This release adds (but disables by default) link-time optimization and
 `profile guided optimization`_ of the base interpreter, which may make
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: fix link

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91571:f3d63bdc598d
Date: 2017-06-07 20:12 +0300
http://bitbucket.org/pypy/pypy/changeset/f3d63bdc598d/

Log:fix link

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -61,7 +61,7 @@
 .. _`help`: project-ideas.html
 .. _`options`: config/commandline.html#general-translation-options
 .. _`these benchmarks show`: 
https://morepypy.blogspot.com/2017/03/async-http-benchmarks-on-pypy3.html
-.. _Gambit: http://gambitresearch.com
+.. _`Gambit Reseach`: http://gambitresearch.com
 
 What is PyPy?
 =
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: mention the shadowstack issue that motivated the early release, other tweaks

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91572:325ce0ce6e7d
Date: 2017-06-07 20:30 +0300
http://bitbucket.org/pypy/pypy/changeset/325ce0ce6e7d/

Log:mention the shadowstack issue that motivated the early release,
other tweaks

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -10,6 +10,10 @@
 This new PyPy2.7 release includes the upstream stdlib version 2.7.13, and
 PyPy3.5 includes the upstream stdlib version 3.5.3.
 
+We fixed critical bugs in the shadowstack_ rootfinder garbage collector
+strategy that crashed multithreaded programs and very rarely showed up
+even in single threaded programs.
+
 We added native PyPy support to profile frames in the vmprof_ statistical
 profiler.
 
@@ -20,7 +24,7 @@
 This release adds (but disables by default) link-time optimization and
 `profile guided optimization`_ of the base interpreter, which may make
 unjitted code run faster. To use these, translate with appropriate
-`options`_.  Be aware of `[1]`_, though.
+`options`_.  Be aware of `issues with gcc toolchains`_, though.
 
 Please let us know if your use case is slow, we have ideas how to make things
 faster but need real-world examples (not micro-benchmarks) of problematic code.
@@ -52,7 +56,8 @@
 with making RPython's JIT even better.
 
 .. _`profile guided optimization`: 
https://pythonfiles.wordpress.com/2017/05/12/enabling-profile-guided-optimizations-for-pypy
-.. _`[1]`: 
https://bitbucket.org/pypy/pypy/issues/2572/link-time-optimization-lto-disabled
+.. _shadowstack: config/translation.gcrootfinder.html
+.. _`issues with gcc toolchains`: 
https://bitbucket.org/pypy/pypy/issues/2572/link-time-optimization-lto-disabled
 .. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html
 .. _grant: 
https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html
 .. _`PyPy`: index.html
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy default: formatting, fix links, tweak wording

2017-06-07 Thread mattip
Author: Matti Picus 
Branch: 
Changeset: r91573:ff44fbcd839d
Date: 2017-06-07 20:43 +0300
http://bitbucket.org/pypy/pypy/changeset/ff44fbcd839d/

Log:formatting, fix links, tweak wording

diff --git a/pypy/doc/release-v5.8.0.rst b/pypy/doc/release-v5.8.0.rst
--- a/pypy/doc/release-v5.8.0.rst
+++ b/pypy/doc/release-v5.8.0.rst
@@ -17,7 +17,7 @@
 We added native PyPy support to profile frames in the vmprof_ statistical
 profiler.
 
-The `struct`` module functions `pack*` and `unpack*` are now much faster,
+The ``struct`` module functions ``pack*`` and ``unpack*`` are now much faster,
 especially on raw buffers and bytearrays. Microbenchmarks show a 2x to 10x
 speedup. Thanks to `Gambit Research`_ for sponsoring this work.
 
@@ -29,20 +29,18 @@
 Please let us know if your use case is slow, we have ideas how to make things
 faster but need real-world examples (not micro-benchmarks) of problematic code.
 
-Work proceeds at a good pace on the PyPy3.5
-version due to a grant_ from the Mozilla Foundation, hence our 3.5.3 beta
-release. Thanks Mozilla !!! While we do not pass all tests yet, asyncio works 
and
-as `these benchmarks show`_ it already gives a nice speed bump.
-We also backported the ``f""`` formatting from 3.6 (as an exception; otherwise
-"PyPy3.5" supports the Python 3.5 language).
+Work sponsored by a Mozilla grant_ continues on PyPy3.5; numerous fixes from
+CPython were ported to PyPy and PEP 489 was fully implemented. Of course the
+bug fixes and performance enhancements mentioned above are part of both PyPy
+2.7 and PyPy 3.5.
 
 CFFI_, which is part of the PyPy release, has been updated to an unreleased 
1.10.1,
 improving an already great package for interfacing with C.
 
-As always, this release fixed many issues and bugs raised by the
+As always, this release fixed many other issues and bugs raised by the
 growing community of PyPy users. We strongly recommend updating.
 
-You can download the v5.8 release here:
+You can download the v5.8 releases here:
 
 http://pypy.org/download.html
 
@@ -57,6 +55,7 @@
 
 .. _`profile guided optimization`: 
https://pythonfiles.wordpress.com/2017/05/12/enabling-profile-guided-optimizations-for-pypy
 .. _shadowstack: config/translation.gcrootfinder.html
+.. _vmprof: http://vmprof.readthedocs.io
 .. _`issues with gcc toolchains`: 
https://bitbucket.org/pypy/pypy/issues/2572/link-time-optimization-lto-disabled
 .. _CFFI: https://cffi.readthedocs.io/en/latest/whatsnew.html
 .. _grant: 
https://morepypy.blogspot.com/2016/08/pypy-gets-funding-from-mozilla-for.html
@@ -66,7 +65,7 @@
 .. _`help`: project-ideas.html
 .. _`options`: config/commandline.html#general-translation-options
 .. _`these benchmarks show`: 
https://morepypy.blogspot.com/2017/03/async-http-benchmarks-on-pypy3.html
-.. _`Gambit Reseach`: http://gambitresearch.com
+.. _`Gambit Research`: http://gambitresearch.com
 
 What is PyPy?
 =
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit