Skip to content

Commit 2c4d2ff

Browse files
committed
Amalgamated source for v50.1
1 parent da5fcf0 commit 2c4d2ff

File tree

1 file changed

+4
-75
lines changed

1 file changed

+4
-75
lines changed

sdk/perfetto.cc

Lines changed: 4 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -44208,8 +44208,8 @@ const char* GetVersionCode();
4420844208
#ifndef GEN_PERFETTO_VERSION_GEN_H_
4420944209
#define GEN_PERFETTO_VERSION_GEN_H_
4421044210

44211-
#define PERFETTO_VERSION_STRING() "v50.0-1c95ae748"
44212-
#define PERFETTO_VERSION_SCM_REVISION() "1c95ae748996032f0106691d5b53322bfd731c86"
44211+
#define PERFETTO_VERSION_STRING() "v50.1-da5fcf015"
44212+
#define PERFETTO_VERSION_SCM_REVISION() "da5fcf015ddda87445f1a359604d7c6f4077e10a"
4421344213

4421444214
#endif // GEN_PERFETTO_VERSION_GEN_H_
4421544215
/*
@@ -59674,7 +59674,7 @@ enum class SockPeerCredMode {
5967459674
#endif
5967559675
};
5967659676

59677-
// Returns the socket family from the full address that perfetto uses.
59677+
// Returns the socket family from the full addres that perfetto uses.
5967859678
// Addr can be:
5967959679
// - /path/to/socket : for linked AF_UNIX sockets.
5968059680
// - @abstract_name : for abstract AF_UNIX sockets.
@@ -59683,25 +59683,6 @@ enum class SockPeerCredMode {
5968359683
// - vsock://-1:3000 : for VM sockets.
5968459684
SockFamily GetSockFamily(const char* addr);
5968559685

59686-
// NetAddrInfo is a wrapper for a full address and it's family
59687-
// and type.
59688-
struct NetAddrInfo {
59689-
NetAddrInfo(const std::string& ip_port, SockFamily family, SockType type)
59690-
: ip_port_(ip_port), family_(family), type_(type) {}
59691-
std::string ip_port_; // full address with ip and port
59692-
SockFamily family_; // socket family
59693-
SockType type_; // socket type
59694-
};
59695-
59696-
// Returns a list of NetAddrInfo from ip and port which
59697-
// ip can be an ipv4 or an ipv6 or a domain.
59698-
// 127.0.0.1 : ipv4 address
59699-
// localhost : domain
59700-
// ::1 : ipv6 address
59701-
// port is a normal tcp port as string.
59702-
std::vector<NetAddrInfo> GetNetAddrInfo(const std::string& ip,
59703-
const std::string& port);
59704-
5970559686
// Returns whether inter-process shared memory is supported for the socket.
5970659687
inline bool SockShmemSupported(SockFamily sock_family) {
5970759688
#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
@@ -60397,43 +60378,17 @@ SockaddrAny MakeSockAddr(SockFamily family, const std::string& socket_name) {
6039760378
PERFETTO_CHECK(false); // For GCC.
6039860379
}
6039960380

60400-
void InitWinSockOnce() {
60381+
ScopedSocketHandle CreateSocketHandle(SockFamily family, SockType type) {
6040160382
#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
6040260383
static bool init_winsock_once = [] {
6040360384
WSADATA ignored{};
6040460385
return WSAStartup(MAKEWORD(2, 2), &ignored) == 0;
6040560386
}();
6040660387
PERFETTO_CHECK(init_winsock_once);
6040760388
#endif
60408-
}
60409-
60410-
ScopedSocketHandle CreateSocketHandle(SockFamily family, SockType type) {
60411-
InitWinSockOnce();
6041260389
return ScopedSocketHandle(socket(MkSockFamily(family), MkSockType(type), 0));
6041360390
}
6041460391

60415-
std::string AddrinfoToIpStr(const struct addrinfo* addrinfo_ptr) {
60416-
PERFETTO_CHECK(addrinfo_ptr && addrinfo_ptr->ai_addr);
60417-
PERFETTO_CHECK((addrinfo_ptr->ai_family == AF_INET) ||
60418-
(addrinfo_ptr->ai_family == AF_INET6));
60419-
60420-
void* addr_ptr = nullptr;
60421-
char ip_str_buffer[INET6_ADDRSTRLEN];
60422-
60423-
if (addrinfo_ptr->ai_family == AF_INET) { // IPv4
60424-
struct sockaddr_in* ipv4_addr =
60425-
reinterpret_cast<struct sockaddr_in*>(addrinfo_ptr->ai_addr);
60426-
addr_ptr = &(ipv4_addr->sin_addr);
60427-
} else if (addrinfo_ptr->ai_family == AF_INET6) { // IPv6
60428-
struct sockaddr_in6* ipv6_addr =
60429-
reinterpret_cast<struct sockaddr_in6*>(addrinfo_ptr->ai_addr);
60430-
addr_ptr = &(ipv6_addr->sin6_addr);
60431-
}
60432-
PERFETTO_CHECK(inet_ntop(addrinfo_ptr->ai_family, addr_ptr, ip_str_buffer,
60433-
sizeof(ip_str_buffer)) != NULL);
60434-
return std::string(ip_str_buffer);
60435-
}
60436-
6043760392
} // namespace
6043860393

6043960394
#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
@@ -60465,32 +60420,6 @@ SockFamily GetSockFamily(const char* addr) {
6046560420
return SockFamily::kUnix; // For anything else assume it's a linked AF_UNIX.
6046660421
}
6046760422

60468-
std::vector<NetAddrInfo> GetNetAddrInfo(const std::string& ip,
60469-
const std::string& port) {
60470-
InitWinSockOnce();
60471-
struct addrinfo hints, *serv_info, *p;
60472-
memset(&hints, 0, sizeof hints);
60473-
hints.ai_family = AF_UNSPEC;
60474-
hints.ai_socktype = SOCK_STREAM;
60475-
hints.ai_flags = AI_PASSIVE;
60476-
PERFETTO_CHECK(getaddrinfo(ip.c_str(), port.c_str(), &hints, &serv_info) ==
60477-
0);
60478-
std::vector<NetAddrInfo> res;
60479-
for (p = serv_info; p != NULL; p = p->ai_next) {
60480-
if (p->ai_family == AF_INET) {
60481-
std::string ip_str = AddrinfoToIpStr(p);
60482-
std::string ip_port = ip_str + ":" + port;
60483-
res.emplace_back(ip_port, SockFamily::kInet, SockType::kStream);
60484-
} else if (p->ai_family == AF_INET6) {
60485-
std::string ip_str = AddrinfoToIpStr(p);
60486-
std::string ip_port = "[" + ip_str + "]:" + port;
60487-
res.emplace_back(ip_port, SockFamily::kInet6, SockType::kStream);
60488-
}
60489-
}
60490-
freeaddrinfo(serv_info);
60491-
return res;
60492-
}
60493-
6049460423
// +-----------------------+
6049560424
// | UnixSocketRaw methods |
6049660425
// +-----------------------+

0 commit comments

Comments
 (0)