OLD | NEW |
1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 tmpstart = tmpend = tmpoffset = 0; | 899 tmpstart = tmpend = tmpoffset = 0; |
900 tmpinode = 0; | 900 tmpinode = 0; |
901 major = minor = 0; // can't get this info in freebsd | 901 major = minor = 0; // can't get this info in freebsd |
902 if (inode) | 902 if (inode) |
903 *inode = 0; // nor this | 903 *inode = 0; // nor this |
904 if (offset) | 904 if (offset) |
905 *offset = 0; // seems like this should be in there, but maybe not | 905 *offset = 0; // seems like this should be in there, but maybe not |
906 // start end resident privateresident obj(?) prot refcnt shadowcnt | 906 // start end resident privateresident obj(?) prot refcnt shadowcnt |
907 // flags copy_on_write needs_copy type filename: | 907 // flags copy_on_write needs_copy type filename: |
908 // 0x8048000 0x804a000 2 0 0xc104ce70 r-x 1 0 0x0 COW NC vnode /bin/cat | 908 // 0x8048000 0x804a000 2 0 0xc104ce70 r-x 1 0 0x0 COW NC vnode /bin/cat |
909 if (sscanf(stext_, "0x%"SCNx64" 0x%"SCNx64" %*d %*d %*p %3s %*d %*d 0x%*x %*
s %*s %*s %n", | 909 if (sscanf(stext_, "0x%" SCNx64 " 0x%" SCNx64 " %*d %*d %*p %3s %*d %*d 0x%*
x %*s %*s %*s %n", |
910 start ? start : &tmpstart, | 910 start ? start : &tmpstart, |
911 end ? end : &tmpend, | 911 end ? end : &tmpend, |
912 flags_, | 912 flags_, |
913 &filename_offset) != 3) continue; | 913 &filename_offset) != 3) continue; |
914 #endif | 914 #endif |
915 | 915 |
916 // Depending on the Linux kernel being used, there may or may not be a space | 916 // Depending on the Linux kernel being used, there may or may not be a space |
917 // after the inode if there is no filename. sscanf will in such situations | 917 // after the inode if there is no filename. sscanf will in such situations |
918 // nondeterministically either fill in filename_offset or not (the results | 918 // nondeterministically either fill in filename_offset or not (the results |
919 // differ on multiple calls in the same run even with identical arguments). | 919 // differ on multiple calls in the same run even with identical arguments). |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 ProcMapsIterator::Buffer linebuf; | 1135 ProcMapsIterator::Buffer linebuf; |
1136 while (it.Next(&start, &end, &flags, &offset, &inode, &filename)) { | 1136 while (it.Next(&start, &end, &flags, &offset, &inode, &filename)) { |
1137 int written = it.FormatLine(linebuf.buf_, sizeof(linebuf.buf_), | 1137 int written = it.FormatLine(linebuf.buf_, sizeof(linebuf.buf_), |
1138 start, end, flags, offset, inode, filename, | 1138 start, end, flags, offset, inode, filename, |
1139 0); | 1139 0); |
1140 RawWrite(fd, linebuf.buf_, written); | 1140 RawWrite(fd, linebuf.buf_, written); |
1141 } | 1141 } |
1142 } | 1142 } |
1143 | 1143 |
1144 } // namespace tcmalloc | 1144 } // namespace tcmalloc |
OLD | NEW |